ibc

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2017 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	PayloadTypeBytes = byte(0x01)
	PayloadTypeCoins = byte(0x02)
)
View Source
const (
	IBCTxTypeRegisterChain = byte(0x01)
	IBCTxTypeUpdateChain   = byte(0x02)
	IBCTxTypePacketCreate  = byte(0x03)
	IBCTxTypePacketPost    = byte(0x04)

	IBCCodeEncodingError       = abci.CodeType(1001)
	IBCCodeChainAlreadyExists  = abci.CodeType(1002)
	IBCCodePacketAlreadyExists = abci.CodeType(1003)
	IBCCodeUnknownHeight       = abci.CodeType(1004)
	IBCCodeInvalidCommit       = abci.CodeType(1005)
	IBCCodeInvalidProof        = abci.CodeType(1006)
)

Variables

This section is empty.

Functions

func GetSequenceNumber added in v0.5.0

func GetSequenceNumber(store types.KVStore, src, dst string) uint64

GetSequenceNumber gets the sequence number for packets being sent from the src chain to the dst chain. The sequence number counts how many packets have been sent. The next packet must include the latest sequence number.

func SaveNewIBCPacket added in v0.5.0

func SaveNewIBCPacket(state types.KVStore, src, dst string, payload Payload)

SaveNewIBCPacket creates an IBC packet with the given payload from the src chain to the dst chain using the correct sequence number. It also increments the sequence number by 1

func SetSequenceNumber added in v0.5.0

func SetSequenceNumber(store types.KVStore, src, dst string, seq uint64)

SetSequenceNumber sets the sequence number for packets being sent from the src chain to the dst chain

Types

type BlockchainGenesis

type BlockchainGenesis struct {
	ChainID string
	Genesis string
}

type BlockchainState

type BlockchainState struct {
	ChainID         string
	Validators      []*tm.Validator
	LastBlockHash   []byte
	LastBlockHeight uint64
}

type CoinsPayload added in v0.5.0

type CoinsPayload struct {
	Address []byte
	Coins   types.Coins
}

func (CoinsPayload) AssertIsPayload added in v0.5.0

func (CoinsPayload) AssertIsPayload()

func (CoinsPayload) Type added in v0.5.0

func (p CoinsPayload) Type() string

func (CoinsPayload) ValidateBasic added in v0.5.0

func (p CoinsPayload) ValidateBasic() abci.Result

type DataPayload added in v0.5.0

type DataPayload []byte

func (DataPayload) AssertIsPayload added in v0.5.0

func (DataPayload) AssertIsPayload()

func (DataPayload) Type added in v0.5.0

func (p DataPayload) Type() string

func (DataPayload) ValidateBasic added in v0.5.0

func (p DataPayload) ValidateBasic() abci.Result

type IBCPacketCreateTx

type IBCPacketCreateTx struct {
	Packet
}

func (IBCPacketCreateTx) AssertIsIBCTx

func (IBCPacketCreateTx) AssertIsIBCTx()

func (IBCPacketCreateTx) ValidateBasic

func (IBCPacketCreateTx) ValidateBasic() (res abci.Result)

type IBCPacketPostTx

type IBCPacketPostTx struct {
	FromChainID     string // The immediate source of the packet, not always Packet.SrcChainID
	FromChainHeight uint64 // The block height in which Packet was committed, to check Proof
	Packet
	Proof *merkle.IAVLProof
}

func (IBCPacketPostTx) AssertIsIBCTx

func (IBCPacketPostTx) AssertIsIBCTx()

func (IBCPacketPostTx) ValidateBasic

func (IBCPacketPostTx) ValidateBasic() (res abci.Result)

type IBCPlugin

type IBCPlugin struct {
}

func New

func New() *IBCPlugin

func (*IBCPlugin) BeginBlock

func (cp *IBCPlugin) BeginBlock(store types.KVStore, hash []byte, header *abci.Header)

func (*IBCPlugin) EndBlock

func (cp *IBCPlugin) EndBlock(store types.KVStore, height uint64) (res abci.ResponseEndBlock)

func (*IBCPlugin) InitChain

func (ibc *IBCPlugin) InitChain(store types.KVStore, vals []*abci.Validator)

func (*IBCPlugin) Name

func (ibc *IBCPlugin) Name() string

func (*IBCPlugin) RunTx

func (ibc *IBCPlugin) RunTx(store types.KVStore, ctx types.CallContext, txBytes []byte) (res abci.Result)

func (*IBCPlugin) SetOption

func (ibc *IBCPlugin) SetOption(store types.KVStore, key string, value string) (log string)

func (*IBCPlugin) StateKey

func (ibc *IBCPlugin) StateKey() []byte

type IBCPluginState

type IBCPluginState struct {
}

type IBCRegisterChainTx

type IBCRegisterChainTx struct {
	BlockchainGenesis
}

func (IBCRegisterChainTx) AssertIsIBCTx

func (IBCRegisterChainTx) AssertIsIBCTx()

func (IBCRegisterChainTx) ValidateBasic

func (IBCRegisterChainTx) ValidateBasic() (res abci.Result)

type IBCStateMachine

type IBCStateMachine struct {
	// contains filtered or unexported fields
}

type IBCTx

type IBCTx interface {
	AssertIsIBCTx()
	ValidateBasic() abci.Result
}

type IBCUpdateChainTx

type IBCUpdateChainTx struct {
	Header tm.Header
	Commit tm.Commit
}

func (IBCUpdateChainTx) AssertIsIBCTx

func (IBCUpdateChainTx) AssertIsIBCTx()

func (IBCUpdateChainTx) ValidateBasic

func (IBCUpdateChainTx) ValidateBasic() (res abci.Result)

type Packet

type Packet struct {
	SrcChainID string
	DstChainID string
	Sequence   uint64
	Type       string // redundant now that Type() is a method on Payload ?
	Payload    Payload
}

func GetIBCPacket added in v0.5.0

func GetIBCPacket(state types.KVStore, src, dst string, seq uint64) (Packet, error)

func NewPacket added in v0.5.0

func NewPacket(src, dst string, seq uint64, payload Payload) Packet

type Payload added in v0.5.0

type Payload interface {
	AssertIsPayload()
	Type() string
	ValidateBasic() abci.Result
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL