packetdata->payload
This commit is contained in:
parent
ded9de18cf
commit
5ebdff2e5e
|
@ -10,7 +10,7 @@ How IBC module treats incoming IBC packets is simillar with how BaseApp treats i
|
|||
| ------------- | ---------- |
|
||||
| Router | Dispatcher |
|
||||
| Tx | Packet |
|
||||
| Msg | PacketData |
|
||||
| Msg | Payload |
|
||||
|
||||
## MVP Specifications
|
||||
|
||||
|
|
|
@ -12,17 +12,17 @@ IBC module will store its own router for handling custom incoming msgs. `IBCPush
|
|||
// User facing API
|
||||
|
||||
type Packet struct {
|
||||
Data PacketData
|
||||
Data Payload
|
||||
SrcChain string
|
||||
DestChain string
|
||||
}
|
||||
|
||||
type PacketData interface {
|
||||
type Payload interface {
|
||||
Type() string
|
||||
ValidateBasic() sdk.Error
|
||||
}
|
||||
|
||||
type TransferPacketData struct {
|
||||
type TransferPayload struct {
|
||||
DestAddr sdk.Address
|
||||
Coins sdk.Coins
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ type EgressKey struct {
|
|||
}
|
||||
|
||||
// Used by other modules
|
||||
func (ibcm IBCMapper) PushPacket(ctx sdk.Context, dest string, data PacketData)
|
||||
func (ibcm IBCMapper) PushPacket(ctx sdk.Context, dest string, payload Payload)
|
||||
```
|
||||
|
||||
`egressKey` stores the outgoing `IBCTransfer`s as a list. Its getter takes an `EgressKey` and returns the length if `egressKey.Index == -1`, an element if `egressKey.Index > 0`.
|
||||
|
|
|
@ -25,17 +25,17 @@ type IBCReceiveMsg struct {
|
|||
// User facing API
|
||||
|
||||
type Packet struct {
|
||||
Data PacketData
|
||||
Data Payload
|
||||
SrcChain string
|
||||
DestChain string
|
||||
}
|
||||
|
||||
type PacketData interface {
|
||||
type Payload interface {
|
||||
Type() string
|
||||
ValidateBasic() sdk.Error
|
||||
}
|
||||
|
||||
type TransferPacketData struct {
|
||||
type TransferPayload struct {
|
||||
SrcAddr sdk.Address
|
||||
DestAddr sdk.Address
|
||||
Coins sdk.Coins
|
||||
|
@ -104,7 +104,7 @@ type HeaderKey struct {
|
|||
}
|
||||
|
||||
// Used by other modules
|
||||
func (ibcm IBCMapper) PushPacket(ctx sdk.Context, dest string, data PacketData)
|
||||
func (ibcm IBCMapper) PushPacket(ctx sdk.Context, dest string, payload Payload)
|
||||
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue