Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- type ClientState
- func (cs ClientState) CheckHeaderAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, ...) (exported.ClientState, exported.ConsensusState, error)
- func (cs ClientState) CheckMisbehaviourAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, ...) (exported.ClientState, error)
- func (cs ClientState) CheckSubstituteAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore, _ sdk.KVStore, ...) (exported.ClientState, error)
- func (cs ClientState) ClientType() string
- func (*ClientState) Descriptor() ([]byte, []int)
- func (cs ClientState) ExportMetadata(_ sdk.KVStore) []exported.GenesisMetadata
- func (cs ClientState) GetLatestHeight() exported.Height
- func (cs ClientState) GetProofSpecs() []*ics23.ProofSpec
- func (cs ClientState) Initialize(_ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, ...) error
- func (m *ClientState) Marshal() (dAtA []byte, err error)
- func (m *ClientState) MarshalTo(dAtA []byte) (int, error)
- func (m *ClientState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ClientState) ProtoMessage()
- func (m *ClientState) Reset()
- func (m *ClientState) Size() (n int)
- func (cs ClientState) Status(_ sdk.Context, _ sdk.KVStore, _ codec.BinaryCodec) exported.Status
- func (m *ClientState) String() string
- func (m *ClientState) Unmarshal(dAtA []byte) error
- func (cs ClientState) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
- func (cs ClientState) Validate() error
- func (cs ClientState) VerifyChannelState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, ...) error
- func (cs ClientState) VerifyClientConsensusState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, ...) error
- func (cs ClientState) VerifyClientState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, ...) error
- func (cs ClientState) VerifyConnectionState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, ...) error
- func (cs ClientState) VerifyNextSequenceRecv(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, ...) error
- func (cs ClientState) VerifyPacketAcknowledgement(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, ...) error
- func (cs ClientState) VerifyPacketCommitment(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, ...) error
- func (cs ClientState) VerifyPacketReceiptAbsence(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, ...) error
- func (cs ClientState) VerifyUpgradeAndUpdateState(_ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.ClientState, ...) (exported.ClientState, exported.ConsensusState, error)
- func (m *ClientState) XXX_DiscardUnknown()
- func (m *ClientState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ClientState) XXX_Merge(src proto.Message)
- func (m *ClientState) XXX_Size() int
- func (m *ClientState) XXX_Unmarshal(b []byte) error
- func (cs ClientState) ZeroCustomFields() exported.ClientState
- type ConsensusState
- func (ConsensusState) ClientType() string
- func (*ConsensusState) Descriptor() ([]byte, []int)
- func (cs ConsensusState) GetRoot() exported.Root
- func (cs ConsensusState) GetTimestamp() uint64
- func (m *ConsensusState) Marshal() (dAtA []byte, err error)
- func (m *ConsensusState) MarshalTo(dAtA []byte) (int, error)
- func (m *ConsensusState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ConsensusState) ProtoMessage()
- func (m *ConsensusState) Reset()
- func (m *ConsensusState) Size() (n int)
- func (m *ConsensusState) String() string
- func (m *ConsensusState) Unmarshal(dAtA []byte) error
- func (cs ConsensusState) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
- func (cs ConsensusState) ValidateBasic() error
- func (m *ConsensusState) XXX_DiscardUnknown()
- func (m *ConsensusState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ConsensusState) XXX_Merge(src proto.Message)
- func (m *ConsensusState) XXX_Size() int
- func (m *ConsensusState) XXX_Unmarshal(b []byte) error
- type Header
- func (Header) ClientType() string
- func (*Header) Descriptor() ([]byte, []int)
- func (h Header) GetHeight() exported.Height
- func (m *Header) Marshal() (dAtA []byte, err error)
- func (m *Header) MarshalTo(dAtA []byte) (int, error)
- func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Header) ProtoMessage()
- func (m *Header) Reset()
- func (m *Header) Size() (n int)
- func (m *Header) String() string
- func (m *Header) Unmarshal(dAtA []byte) error
- func (h Header) ValidateBasic() error
- func (m *Header) XXX_DiscardUnknown()
- func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Header) XXX_Merge(src proto.Message)
- func (m *Header) XXX_Size() int
- func (m *Header) XXX_Unmarshal(b []byte) error
Constants ¶
const (
Mock string = "mock-client"
)
const (
ModuleName = "mock-client"
)
Variables ¶
var ( ErrInvalidHeader = sdkerrors.Register(ModuleName, 2, "invalid header") ErrInvalidSequence = sdkerrors.Register(ModuleName, 3, "invalid sequence") ErrInvalidSignatureAndData = sdkerrors.Register(ModuleName, 4, "invalid signature and data") ErrSignatureVerificationFailed = sdkerrors.Register(ModuleName, 5, "signature verification failed") ErrInvalidProof = sdkerrors.Register(ModuleName, 6, "invalid Mock proof") ErrInvalidDataType = sdkerrors.Register(ModuleName, 7, "invalid data type") )
Functions ¶
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces register the ibc channel submodule interfaces to protobuf Any.
Types ¶
type ClientState ¶
type ClientState struct {
LatestHeight *types.Height `protobuf:"bytes,1,opt,name=latest_height,json=latestHeight,proto3" json:"latest_height,omitempty"`
}
func NewClientState ¶
func NewClientState(latestHeight clienttypes.Height, allowUpdateAfterProposal bool) *ClientState
NewClientState creates a new ClientState instance.
func (ClientState) CheckHeaderAndUpdateState ¶
func (cs ClientState) CheckHeaderAndUpdateState( ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, header exported.Header, ) (exported.ClientState, exported.ConsensusState, error)
CheckHeaderAndUpdateState checks if the provided header is valid and updates the consensus state if appropriate. It returns an error if: - the header provided is not parseable to a Mock header
func (ClientState) CheckMisbehaviourAndUpdateState ¶
func (cs ClientState) CheckMisbehaviourAndUpdateState( ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, misbehaviour exported.Misbehaviour, ) (exported.ClientState, error)
func (ClientState) CheckSubstituteAndUpdateState ¶
func (cs ClientState) CheckSubstituteAndUpdateState( ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore, _ sdk.KVStore, substituteClient exported.ClientState, ) (exported.ClientState, error)
func (ClientState) ClientType ¶
func (cs ClientState) ClientType() string
ClientType returns a type of the client.
func (*ClientState) Descriptor ¶
func (*ClientState) Descriptor() ([]byte, []int)
func (ClientState) ExportMetadata ¶
func (cs ClientState) ExportMetadata(_ sdk.KVStore) []exported.GenesisMetadata
ExportMetadata is a no-op since Mock does not store any metadata in client store
func (ClientState) GetLatestHeight ¶
func (cs ClientState) GetLatestHeight() exported.Height
GetLatestHeight returns the latest height. Return exported.Height to satisfy ClientState interface
func (ClientState) GetProofSpecs ¶
func (cs ClientState) GetProofSpecs() []*ics23.ProofSpec
GetProofSpecs returns nil proof specs since client state verification uses signatures.
func (ClientState) Initialize ¶
func (cs ClientState) Initialize(_ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, consState exported.ConsensusState) error
Initialize will check that initial consensus state is equal to the latest consensus state of the initial client.
func (*ClientState) Marshal ¶
func (m *ClientState) Marshal() (dAtA []byte, err error)
func (*ClientState) MarshalToSizedBuffer ¶
func (m *ClientState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ClientState) ProtoMessage ¶
func (*ClientState) ProtoMessage()
func (*ClientState) Reset ¶
func (m *ClientState) Reset()
func (*ClientState) Size ¶
func (m *ClientState) Size() (n int)
func (ClientState) Status ¶
func (cs ClientState) Status(_ sdk.Context, _ sdk.KVStore, _ codec.BinaryCodec) exported.Status
Status returns the status of the mock client. It always returns active.
func (*ClientState) String ¶
func (m *ClientState) String() string
func (*ClientState) Unmarshal ¶
func (m *ClientState) Unmarshal(dAtA []byte) error
func (ClientState) UnpackInterfaces ¶
func (cs ClientState) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (ClientState) Validate ¶
func (cs ClientState) Validate() error
Validate performs basic validation of the client state fields.
func (ClientState) VerifyChannelState ¶
func (cs ClientState) VerifyChannelState( store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, prefix exported.Prefix, proof []byte, portID, channelID string, channelEnd exported.ChannelI, ) error
VerifyChannelState verifies a proof of the channel state of the specified channel end, under the specified port, stored on the target machine.
func (ClientState) VerifyClientConsensusState ¶
func (cs ClientState) VerifyClientConsensusState( store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, counterpartyClientIdentifier string, consensusHeight exported.Height, prefix exported.Prefix, proof []byte, consensusState exported.ConsensusState, ) error
VerifyClientConsensusState verifies a proof of the consensus state of the running chain stored on the Mock.
func (ClientState) VerifyClientState ¶
func (cs ClientState) VerifyClientState( store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, prefix exported.Prefix, counterpartyClientIdentifier string, proof []byte, clientState exported.ClientState, ) error
VerifyClientState verifies a proof of the client state of the running chain stored on the Mock.
func (ClientState) VerifyConnectionState ¶
func (cs ClientState) VerifyConnectionState( store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, prefix exported.Prefix, proof []byte, connectionID string, connectionEnd exported.ConnectionI, ) error
VerifyConnectionState verifies a proof of the connection state of the specified connection end stored on the target machine.
func (ClientState) VerifyNextSequenceRecv ¶
func (cs ClientState) VerifyNextSequenceRecv( ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, _ uint64, _ uint64, prefix exported.Prefix, proof []byte, portID, channelID string, nextSequenceRecv uint64, ) error
VerifyNextSequenceRecv verifies a proof of the next sequence number to be received of the specified channel at the specified port.
func (ClientState) VerifyPacketAcknowledgement ¶
func (cs ClientState) VerifyPacketAcknowledgement( ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, _ uint64, _ uint64, prefix exported.Prefix, proof []byte, portID, channelID string, packetSequence uint64, acknowledgement []byte, ) error
VerifyPacketAcknowledgement verifies a proof of an incoming packet acknowledgement at the specified port, specified channel, and specified sequence.
func (ClientState) VerifyPacketCommitment ¶
func (cs ClientState) VerifyPacketCommitment( ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, _ uint64, _ uint64, prefix exported.Prefix, proof []byte, portID, channelID string, packetSequence uint64, commitmentBytes []byte, ) error
VerifyPacketCommitment verifies a proof of an outgoing packet commitment at the specified port, specified channel, and specified sequence.
func (ClientState) VerifyPacketReceiptAbsence ¶
func (cs ClientState) VerifyPacketReceiptAbsence( ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, _ uint64, _ uint64, prefix exported.Prefix, proof []byte, portID, channelID string, packetSequence uint64, ) error
VerifyPacketReceiptAbsence verifies a proof of the absence of an incoming packet receipt at the specified port, specified channel, and specified sequence.
func (ClientState) VerifyUpgradeAndUpdateState ¶
func (cs ClientState) VerifyUpgradeAndUpdateState( _ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.ClientState, _ exported.ConsensusState, _, _ []byte, ) (exported.ClientState, exported.ConsensusState, error)
VerifyUpgradeAndUpdateState returns an error since Mock client does not support upgrades
func (*ClientState) XXX_DiscardUnknown ¶
func (m *ClientState) XXX_DiscardUnknown()
func (*ClientState) XXX_Marshal ¶
func (m *ClientState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ClientState) XXX_Merge ¶
func (m *ClientState) XXX_Merge(src proto.Message)
func (*ClientState) XXX_Size ¶
func (m *ClientState) XXX_Size() int
func (*ClientState) XXX_Unmarshal ¶
func (m *ClientState) XXX_Unmarshal(b []byte) error
func (ClientState) ZeroCustomFields ¶
func (cs ClientState) ZeroCustomFields() exported.ClientState
ZeroCustomFields returns Mock client state with client-specific fields FrozenSequence, and AllowUpdateAfterProposal zeroed out
type ConsensusState ¶
type ConsensusState struct {
Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
}
func (ConsensusState) ClientType ¶
func (ConsensusState) ClientType() string
ClientType returns mock-client type.
func (*ConsensusState) Descriptor ¶
func (*ConsensusState) Descriptor() ([]byte, []int)
func (ConsensusState) GetRoot ¶
func (cs ConsensusState) GetRoot() exported.Root
GetRoot returns nil since mock-client do not have roots.
func (ConsensusState) GetTimestamp ¶
func (cs ConsensusState) GetTimestamp() uint64
GetTimestamp returns zero.
func (*ConsensusState) Marshal ¶
func (m *ConsensusState) Marshal() (dAtA []byte, err error)
func (*ConsensusState) MarshalToSizedBuffer ¶
func (m *ConsensusState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ConsensusState) ProtoMessage ¶
func (*ConsensusState) ProtoMessage()
func (*ConsensusState) Reset ¶
func (m *ConsensusState) Reset()
func (*ConsensusState) Size ¶
func (m *ConsensusState) Size() (n int)
func (*ConsensusState) String ¶
func (m *ConsensusState) String() string
func (*ConsensusState) Unmarshal ¶
func (m *ConsensusState) Unmarshal(dAtA []byte) error
func (ConsensusState) UnpackInterfaces ¶
func (cs ConsensusState) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (ConsensusState) ValidateBasic ¶
func (cs ConsensusState) ValidateBasic() error
ValidateBasic defines basic validation for the mock-client consensus state.
func (*ConsensusState) XXX_DiscardUnknown ¶
func (m *ConsensusState) XXX_DiscardUnknown()
func (*ConsensusState) XXX_Marshal ¶
func (m *ConsensusState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ConsensusState) XXX_Merge ¶
func (m *ConsensusState) XXX_Merge(src proto.Message)
func (*ConsensusState) XXX_Size ¶
func (m *ConsensusState) XXX_Size() int
func (*ConsensusState) XXX_Unmarshal ¶
func (m *ConsensusState) XXX_Unmarshal(b []byte) error
type Header ¶
type Header struct { Height *types.Height `protobuf:"bytes,1,opt,name=height,proto3" json:"height,omitempty"` Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` }
func (Header) ClientType ¶
ClientType return the client identifier of mock-client.
func (*Header) Descriptor ¶
func (Header) GetHeight ¶
GetHeight returns the current sequence number as the height. Return clientexported.Height to satisfy interface Revision number is always 0 for a solo-machine
func (*Header) MarshalToSizedBuffer ¶
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (Header) ValidateBasic ¶
ValidateBasic ensures that the sequence, signature and public key have all been initialized.
func (*Header) XXX_DiscardUnknown ¶
func (m *Header) XXX_DiscardUnknown()