Documentation
¶
Index ¶
- Constants
- func EgressKey(destChain string, index uint64) []byte
- func EgressLengthKey(destChain string) []byte
- func ErrIdenticalChains(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidSequence(codespace sdk.CodespaceType) sdk.Error
- func IngressSequenceKey(srcChain string) []byte
- func NewHandler(ibcm Mapper, ck BankKeeper) sdk.Handler
- func RegisterCodec(cdc *codec.Codec)
- type BankKeeper
- type IBCPacket
- type IBCReceiveMsg
- type IBCTransferMsg
- type Mapper
- func (ibcm Mapper) GetIngressSequence(ctx sdk.Context, srcChain string) uint64
- func (ibcm Mapper) PostIBCPacket(ctx sdk.Context, packet IBCPacket) sdk.Error
- func (ibcm Mapper) ReceiveIBCPacket(ctx sdk.Context, packet IBCPacket) sdk.Error
- func (ibcm Mapper) SetIngressSequence(ctx sdk.Context, srcChain string, sequence uint64)
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = "ibc" // IBC errors reserve 200 - 299. CodeInvalidSequence sdk.CodeType = 200 CodeIdenticalChains sdk.CodeType = 201 CodeUnknownRequest sdk.CodeType = sdk.CodeUnknownRequest )
IBC errors reserve 200 ~ 299.
Variables ¶
This section is empty.
Functions ¶
func EgressLengthKey ¶ added in v0.2.0
Stores the number of outgoing IBC packets under "egress/index".
func ErrIdenticalChains ¶ added in v0.2.0
func ErrIdenticalChains(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidSequence ¶ added in v0.2.0
func ErrInvalidSequence(codespace sdk.CodespaceType) sdk.Error
nolint
func IngressSequenceKey ¶ added in v0.2.0
Stores the sequence number of incoming IBC packet under "ingress/index".
func NewHandler ¶
func NewHandler(ibcm Mapper, ck BankKeeper) sdk.Handler
Types ¶
type BankKeeper ¶ added in v0.32.0
type BankKeeper interface { AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Tags, sdk.Error) SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Tags, sdk.Error) }
expected bank keeper
type IBCPacket ¶ added in v0.2.0
type IBCPacket struct { SrcAddr sdk.AccAddress `json:"src_addr"` DestAddr sdk.AccAddress `json:"dest_addr"` Coins sdk.Coins `json:"coins"` SrcChain string `json:"src_chain"` DestChain string `json:"dest_chain"` }
nolint - TODO rename to Packet as IBCPacket stutters (golint) IBCPacket defines a piece of data that can be send between two separate blockchains.
func NewIBCPacket ¶ added in v0.2.0
func NewIBCPacket(srcAddr sdk.AccAddress, destAddr sdk.AccAddress, coins sdk.Coins, srcChain string, destChain string) IBCPacket
func (IBCPacket) ValidateBasic ¶ added in v0.2.0
validator the ibc packey
type IBCReceiveMsg ¶ added in v0.2.0
type IBCReceiveMsg struct { IBCPacket Relayer sdk.AccAddress Sequence uint64 }
nolint - TODO rename to ReceiveMsg as folks will reference with ibc.ReceiveMsg IBCReceiveMsg defines the message that a relayer uses to post an IBCPacket to the destination chain.
func (IBCReceiveMsg) GetSignBytes ¶ added in v0.2.0
func (msg IBCReceiveMsg) GetSignBytes() []byte
get the sign bytes for ibc receive message
func (IBCReceiveMsg) GetSigners ¶ added in v0.2.0
func (msg IBCReceiveMsg) GetSigners() []sdk.AccAddress
x/bank/tx.go MsgSend.GetSigners()
func (IBCReceiveMsg) Type ¶ added in v0.2.0
func (msg IBCReceiveMsg) Type() string
func (IBCReceiveMsg) ValidateBasic ¶ added in v0.2.0
func (msg IBCReceiveMsg) ValidateBasic() sdk.Error
type IBCTransferMsg ¶ added in v0.2.0
type IBCTransferMsg struct {
IBCPacket
}
nolint - TODO rename to TransferMsg as folks will reference with ibc.TransferMsg IBCTransferMsg defines how another module can send an IBCPacket.
func (IBCTransferMsg) GetSignBytes ¶ added in v0.2.0
func (msg IBCTransferMsg) GetSignBytes() []byte
get the sign bytes for ibc transfer message
func (IBCTransferMsg) GetSigners ¶ added in v0.2.0
func (msg IBCTransferMsg) GetSigners() []sdk.AccAddress
x/bank/tx.go MsgSend.GetSigners()
func (IBCTransferMsg) Type ¶ added in v0.2.0
func (msg IBCTransferMsg) Type() string
func (IBCTransferMsg) ValidateBasic ¶ added in v0.2.0
func (msg IBCTransferMsg) ValidateBasic() sdk.Error
validate ibc transfer message
type Mapper ¶ added in v0.16.0
type Mapper struct {
// contains filtered or unexported fields
}
IBC Mapper
func NewMapper ¶ added in v0.16.0
XXX: The Mapper should not take a CoinKeeper. Rather have the CoinKeeper take an Mapper.
func (Mapper) GetIngressSequence ¶ added in v0.16.0
TODO add description
func (Mapper) PostIBCPacket ¶ added in v0.16.0
XXX: This is not the public API. This will change in MVP2 and will henceforth only be invoked from another module directly and not through a user transaction. TODO: Handle invalid IBC packets and return errors.
func (Mapper) ReceiveIBCPacket ¶ added in v0.16.0
XXX: In the future every module is able to register it's own handler for handling it's own IBC packets. The "ibc" handler will only route the packets to the appropriate callbacks. XXX: For now this handles all interactions with the CoinKeeper. XXX: This needs to do some authentication checking.