Documentation
¶
Index ¶
Constants ¶
const ( // Solomachine is used to indicate that the light client is a solo machine. Solomachine string = "06-solomachine" // Tendermint is used to indicate that the client uses the Tendermint Consensus Algorithm. Tendermint string = "07-tendermint" // Localhost is the client types for a localhost client. It is also used as the clientID Localhost string = "09-localhost" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelI ¶
type ChannelI interface {
GetState() int32
GetOrdering() int32
GetCounterparty() CounterpartyChannelI
GetConnectionHops() []string
GetVersion() string
ValidateBasic() error
}
ChannelI defines the standard interface for a channel end.
type ClientState ¶
type ClientState interface {
proto.Message
ClientType() string
GetLatestHeight() Height
IsFrozen() bool
GetFrozenHeight() Height
Validate() error
GetProofSpecs() []*ics23.ProofSpec
Initialize(ctx sdk.Context, store sdk.KVStore, cs ConsensusState) error
CheckHeaderAndUpdateState(sdk.Context, codec.BinaryMarshaler, sdk.KVStore, Header) (ClientState, ConsensusState, error)
VerifyUpgradeAndUpdateState(
ctx sdk.Context,
cdc codec.BinaryMarshaler,
store sdk.KVStore,
newClient ClientState,
proofUpgradeClient,
proofUpgradeConsState []byte,
) (ClientState, ConsensusState, error)
// 清除用户自定义字段
ZeroCustomFields() ClientState
VerifyClientState(
store sdk.KVStore,
cdc codec.BinaryMarshaler,
height Height,
prefix Prefix,
counterpartyClientIdentifier string,
proof []byte,
clientState ClientState,
) error
VerifyClientConsensusState(
store sdk.KVStore,
cdc codec.BinaryMarshaler,
height Height,
counterpartyClientIdentifier string,
consensusHeight Height,
prefix Prefix,
proof []byte,
consensusState ConsensusState,
) error
VerifyConnectionState(
store sdk.KVStore,
cdc codec.BinaryMarshaler,
height Height,
prefix Prefix,
proof []byte,
connectionID string,
connectionEnd ConnectionI,
) error
VerifyChannelState(
store sdk.KVStore,
cdc codec.BinaryMarshaler,
height Height,
prefix Prefix,
proof []byte,
portID,
channelID string,
channel ChannelI,
) error
VerifyPacketCommitment(
store sdk.KVStore,
cdc codec.BinaryMarshaler,
height Height,
currentTimestamp uint64,
delayPeriod uint64,
prefix Prefix,
proof []byte,
portID,
channelID string,
sequence uint64,
commitmentBytes []byte,
) error
VerifyPacketAcknowledgement(
store sdk.KVStore,
cdc codec.BinaryMarshaler,
height Height,
currentTimestamp uint64,
delayPeriod uint64,
prefix Prefix,
proof []byte,
portID,
channelID string,
sequence uint64,
acknowledgement []byte,
) error
VerifyPacketReceiptAbsence(
store sdk.KVStore,
cdc codec.BinaryMarshaler,
height Height,
currentTimestamp uint64,
delayPeriod uint64,
prefix Prefix,
proof []byte,
portID,
channelID string,
sequence uint64,
) error
VerifyNextSequenceRecv(
store sdk.KVStore,
cdc codec.BinaryMarshaler,
height Height,
currentTimestamp uint64,
delayPeriod uint64,
prefix Prefix,
proof []byte,
portID,
channelID string,
nextSequenceRecv uint64,
) error
}
type ConnectionI ¶
type ConsensusState ¶
type CounterpartyChannelI ¶
type CounterpartyChannelI interface {
GetPortID() string
GetChannelID() string
ValidateBasic() error
}
CounterpartyChannelI defines the standard interface for a channel end's counterparty.
type CounterpartyConnectionI ¶
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
LT(Height) bool
LTE(Height) bool
EQ(Height) bool
GT(Height) bool
GTE(Height) bool
GetRevisionNumber() uint64
GetRevisionHeight() uint64
Increment() Height
Decrement() (Height, bool)
String() string
}
Height is a wrapper interface over clienttypes.Height all clients must use the concrete implementation in types
type PacketI ¶
type PacketI interface {
GetSequence() uint64
GetTimeoutHeight() Height
GetTimeoutTimestamp() uint64
GetSourcePort() string
GetSourceChannel() string
GetDestPort() string
GetDestChannel() 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 Proof ¶
type Proof interface {
VerifyMembership([]*ics23.ProofSpec, Root, Path, []byte) error
VerifyNonMembership([]*ics23.ProofSpec, Root, Path) error
Empty() bool
ValidateBasic() error
}
Proof implements spec:CommitmentProof. Proof can prove whether the key-value pair is a part of the Root or not. Each proof has designated key-value pair it is able to prove. Proofs includes key but value is provided dynamically at the verification time.