Documentation ¶
Index ¶
- Constants
- Variables
- func Wrap(err error, description string) error
- func Wrapf(err error, format string, args ...interface{}) error
- type CleanPacketI
- type ClientState
- type ConsensusState
- type Error
- type Header
- type Height
- type IError
- type PacketI
- type Path
- type Prefix
- type Root
- type UpdateClientRequest
- type WrappedError
Constants ¶
const RootCodeSpace = "tibc-sdk-go"
Variables ¶
var ( ErrInternal = Register(RootCodeSpace, 1, "internal") ErrChainConn = Register(RootCodeSpace, 2, "connection chain failed") ErrGetLightClientState = Register(RootCodeSpace, 3, "failed to get light client state") ErrGetBlockHeader = Register(RootCodeSpace, 4, "failed to get block header") ErrUpdateClient = Register(RootCodeSpace, 5, "failed to update client") ErrGetPackets = Register(RootCodeSpace, 6, "failed to get packets") ErrGetCommitmentPacket = Register(RootCodeSpace, 7, "failed to get commitment packet") ErrGetAckPacket = Register(RootCodeSpace, 8, "failed to get ack packet") ErrGetReceiptPacket = Register(RootCodeSpace, 9, "failed to get receipt packet") ErrGetProof = Register(RootCodeSpace, 10, "failed to get proof") ErrGetLatestHeight = Register(RootCodeSpace, 11, "failed to get latest height") ErrRecvPacket = Register(RootCodeSpace, 12, "failed to recv packet") ErrNotProduced = Register(RootCodeSpace, 13, "failed to not produced") ErrUnknownMsg = Register(RootCodeSpace, 14, "failed to unknown msg type") ErrUnpackAny = Register(RootCodeSpace, 15, "failed to unpack any") ErrGetLightClientConsensusState = Register(RootCodeSpace, 16, "failed to light consensus state") ErrGetRelayer = Register(RootCodeSpace, 17, "failed to get relayer") ErrGetAddress = Register(RootCodeSpace, 18, "failed to get address") ErrPackAny = Register(RootCodeSpace, 19, "failed to pack any") ErrGetUnreceivedPacket = Register(RootCodeSpace, 20, "failed to get unreceived packet") ErrSendAckPacket = Register(RootCodeSpace, 21, "failed to send ack packet") ErrSendCleanPacket = Register(RootCodeSpace, 22, "failed to send clean packet") ErrRecvCleanPacket = Register(RootCodeSpace, 23, "failed to recv clean packet") ErrNftTransfer = Register(RootCodeSpace, 24, "failed to send nft transfer ") ErrInvalidConsensus = Register(RootCodeSpace, 25, "invalid consensus state") ErrInvalidHeader = Register(RootCodeSpace, 26, "invalid consensus state") ErrInvalidHeight = Register(RootCodeSpace, 27, "invalid height") ErrInvalidAddress = Register(RootCodeSpace, 28, "invalid address") ErrInvalidID = Register(RootCodeSpace, 29, "invalid identifier") )
Functions ¶
Types ¶
type CleanPacketI ¶
type CleanPacketI interface { GetSequence() uint64 GetSourceChain() string GetDestChain() string GetRelayChain() string ValidateBasic() error }
CleanPacketI defines the standard interface for TIBC clean packets
type ClientState ¶
type ClientState interface { proto.Message ClientType() string GetLatestHeight() Height Validate() error GetDelayTime() uint64 GetDelayBlock() uint64 GetPrefix() Prefix }
ClientState defines the required common functions for light clients.
type ConsensusState ¶
type ConsensusState interface { proto.Message ClientType() string // Consensus kind // GetRoot returns the commitment root of the consensus state, // which is used for key-value pair verification. GetRoot() Root // GetTimestamp returns the timestamp (in nanoseconds) of the consensus state GetTimestamp() uint64 ValidateBasic() error }
ConsensusState is the state of the consensus process
type Header ¶
type Header interface { proto.Message ClientType() string GetHeight() Height ValidateBasic() error }
Header is the consensus state update information
type Height ¶
type Height interface { IsZero() bool GetRevisionNumber() uint64 GetRevisionHeight() uint64 Increment() Height Decrement() (Height, bool) String() string }
Height is a wrapper interface over client.Height all clients must use the concrete implementation in types
type IError ¶
func IErrorWrap ¶
type PacketI ¶
type PacketI interface { GetSequence() uint64 GetPort() string GetSourceChain() string GetDestChain() string GetRelayChain() string GetData() []byte ValidateBasic() error }
PacketI defines the standard interface for IBC packets
type Path ¶
Path implements spec:CommitmentPath. A path is the additional information provided to the verification function.
type Prefix ¶
Prefix implements spec:CommitmentPrefix. Prefix represents the common "prefix" that a set of keys shares.
type Root ¶
Root implements spec:CommitmentRoot. A root is constructed from a set of key-value pairs, and the inclusion or non-inclusion of an arbitrary key-value pair can be proven with the proof.
type UpdateClientRequest ¶
type UpdateClientRequest struct { ChainName string `json:"chain_name"` // header to update the light client Header Header `json:"header"` }
TODO:
type WrappedError ¶
type WrappedError struct {
// contains filtered or unexported fields
}
func (*WrappedError) Cause ¶
func (e *WrappedError) Cause() error
func (*WrappedError) Error ¶
func (e *WrappedError) Error() string
func (*WrappedError) Is ¶
func (e *WrappedError) Is(target error) bool
Is reports whether any error in e's chain matches a target.
func (*WrappedError) Unwrap ¶
func (e *WrappedError) Unwrap() error
Unwrap implements the built-in errors.Unwrap