Documentation ¶
Index ¶
- Constants
- Variables
- func NewClientState(height clienttypes.Height) exported.ClientState
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- type ClientState
- func (cs ClientState) CheckForMisbehaviour(_ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.ClientMessage) bool
- func (cs ClientState) CheckSubstituteAndUpdateState(_ sdk.Context, _ codec.BinaryCodec, _, _ 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) GetTimestampAtHeight(ctx sdk.Context, _ sdk.KVStore, _ codec.BinaryCodec, _ exported.Height) (uint64, error)
- func (cs ClientState) Initialize(ctx sdk.Context, cdc codec.BinaryCodec, clientStore 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) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, ...) []exported.Height
- func (cs ClientState) UpdateStateOnMisbehaviour(_ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.ClientMessage)
- func (cs ClientState) Validate() error
- func (cs ClientState) VerifyClientMessage(_ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.ClientMessage) error
- func (cs ClientState) VerifyMembership(ctx sdk.Context, store sdk.KVStore, _ codec.BinaryCodec, _ exported.Height, ...) error
- func (cs ClientState) VerifyNonMembership(ctx sdk.Context, store sdk.KVStore, _ codec.BinaryCodec, _ exported.Height, ...) error
- func (cs ClientState) VerifyUpgradeAndUpdateState(_ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.ClientState, ...) 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
Constants ¶
const (
// ModuleName defines the 09-localhost light client module name
ModuleName = "09-localhost"
)
Variables ¶
var ( ErrInvalidLengthLocalhost = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowLocalhost = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupLocalhost = fmt.Errorf("proto: unexpected end of group") )
var SentinelProof = []byte{0x01}
SentinelProof defines the 09-localhost sentinel proof. Submission of nil or empty proofs is disallowed in core IBC messaging. This serves as a placeholder value for relayers to leverage as the proof field in various message types. Localhost client state verification will fail if the sentintel proof value is not provided.
Functions ¶
func NewClientState ¶
func NewClientState(height clienttypes.Height) exported.ClientState
NewClientState creates a new 09-localhost ClientState instance.
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers the tendermint concrete client-related implementations and interfaces.
Types ¶
type ClientState ¶
type ClientState struct { // the latest block height LatestHeight types.Height `protobuf:"bytes,1,opt,name=latest_height,json=latestHeight,proto3" json:"latest_height"` }
ClientState defines the 09-localhost client state
func (ClientState) CheckForMisbehaviour ¶
func (cs ClientState) CheckForMisbehaviour(_ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.ClientMessage) bool
CheckForMisbehaviour is unsupported by the 09-localhost client type and performs a no-op, returning false.
func (ClientState) CheckSubstituteAndUpdateState ¶
func (cs ClientState) CheckSubstituteAndUpdateState(_ sdk.Context, _ codec.BinaryCodec, _, _ sdk.KVStore, _ exported.ClientState) error
CheckSubstituteAndUpdateState returns an error. The localhost cannot be modified by proposals.
func (ClientState) ClientType ¶
func (cs ClientState) ClientType() string
ClientType returns the 09-localhost client type.
func (*ClientState) Descriptor ¶
func (*ClientState) Descriptor() ([]byte, []int)
func (ClientState) ExportMetadata ¶
func (cs ClientState) ExportMetadata(_ sdk.KVStore) []exported.GenesisMetadata
ExportMetadata is a no-op for the 09-localhost client.
func (ClientState) GetLatestHeight ¶
func (cs ClientState) GetLatestHeight() exported.Height
GetLatestHeight returns the 09-localhost client state latest height.
func (ClientState) GetTimestampAtHeight ¶
func (cs ClientState) GetTimestampAtHeight(ctx sdk.Context, _ sdk.KVStore, _ codec.BinaryCodec, _ exported.Height) (uint64, error)
GetTimestampAtHeight returns the current block time retrieved from the application context. The localhost client does not store consensus states and thus cannot provide a timestamp for the provided height.
func (ClientState) Initialize ¶
func (cs ClientState) Initialize(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, consState exported.ConsensusState) error
Initialize ensures that initial consensus state for localhost is nil.
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 always returns Active. The 09-localhost status cannot be changed.
func (*ClientState) String ¶
func (m *ClientState) String() string
func (*ClientState) Unmarshal ¶
func (m *ClientState) Unmarshal(dAtA []byte) error
func (ClientState) UpdateState ¶
func (cs ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, _ exported.ClientMessage) []exported.Height
UpdateState updates and stores as necessary any associated information for an IBC client, such as the ClientState and corresponding ConsensusState. Upon successful update, a list of consensus heights is returned. It assumes the ClientMessage has already been verified.
func (ClientState) UpdateStateOnMisbehaviour ¶
func (cs ClientState) UpdateStateOnMisbehaviour(_ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.ClientMessage)
UpdateStateOnMisbehaviour is unsupported by the 09-localhost client type and performs a no-op.
func (ClientState) Validate ¶
func (cs ClientState) Validate() error
Validate performs a basic validation of the client state fields.
func (ClientState) VerifyClientMessage ¶
func (cs ClientState) VerifyClientMessage(_ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.ClientMessage) error
VerifyClientMessage is unsupported by the 09-localhost client type and returns an error.
func (ClientState) VerifyMembership ¶
func (cs ClientState) VerifyMembership( ctx sdk.Context, store sdk.KVStore, _ codec.BinaryCodec, _ exported.Height, _ uint64, _ uint64, proof []byte, path exported.Path, value []byte, ) error
VerifyMembership is a generic proof verification method which verifies the existence of a given key and value within the IBC store. The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24). The caller must provide the full IBC store.
func (ClientState) VerifyNonMembership ¶
func (cs ClientState) VerifyNonMembership( ctx sdk.Context, store sdk.KVStore, _ codec.BinaryCodec, _ exported.Height, _ uint64, _ uint64, proof []byte, path exported.Path, ) error
VerifyNonMembership is a generic proof verification method which verifies the absence of a given CommitmentPath within the IBC store. The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24). The caller must provide the full IBC store.
func (ClientState) VerifyUpgradeAndUpdateState ¶
func (cs ClientState) VerifyUpgradeAndUpdateState( _ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.ClientState, _ exported.ConsensusState, _, _ []byte, ) error
VerifyUpgradeAndUpdateState returns an error since localhost cannot be upgraded
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 the same client state since there are no custom fields in the 09-localhost client state.