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 ¶ added in v0.1.4
func NewClientState(height clienttypes.Height) exported.ClientState
NewClientState creates a new 09-localhost ClientState instance.
func RegisterInterfaces ¶ added in v0.1.4
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers the tendermint concrete client-related implementations and interfaces.
Types ¶
type ClientState ¶ added in v0.1.4
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 ¶ added in v0.1.4
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 ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (cs ClientState) ClientType() string
ClientType returns the 09-localhost client type.
func (*ClientState) Descriptor ¶ added in v0.1.4
func (*ClientState) Descriptor() ([]byte, []int)
func (ClientState) ExportMetadata ¶ added in v0.1.4
func (cs ClientState) ExportMetadata(_ sdk.KVStore) []exported.GenesisMetadata
ExportMetadata is a no-op for the 09-localhost client.
func (ClientState) GetLatestHeight ¶ added in v0.1.4
func (cs ClientState) GetLatestHeight() exported.Height
GetLatestHeight returns the 09-localhost client state latest height.
func (ClientState) GetTimestampAtHeight ¶ added in v0.1.4
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 ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (m *ClientState) Marshal() (dAtA []byte, err error)
func (*ClientState) MarshalTo ¶ added in v0.1.4
func (m *ClientState) MarshalTo(dAtA []byte) (int, error)
func (*ClientState) MarshalToSizedBuffer ¶ added in v0.1.4
func (m *ClientState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ClientState) ProtoMessage ¶ added in v0.1.4
func (*ClientState) ProtoMessage()
func (*ClientState) Reset ¶ added in v0.1.4
func (m *ClientState) Reset()
func (*ClientState) Size ¶ added in v0.1.4
func (m *ClientState) Size() (n int)
func (ClientState) Status ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (m *ClientState) String() string
func (*ClientState) Unmarshal ¶ added in v0.1.4
func (m *ClientState) Unmarshal(dAtA []byte) error
func (ClientState) UpdateState ¶ added in v0.1.4
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 ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (cs ClientState) Validate() error
Validate performs a basic validation of the client state fields.
func (ClientState) VerifyClientMessage ¶ added in v0.1.4
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 ¶ added in v0.1.4
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 ¶ added in v0.1.4
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 ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (m *ClientState) XXX_DiscardUnknown()
func (*ClientState) XXX_Marshal ¶ added in v0.1.4
func (m *ClientState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ClientState) XXX_Merge ¶ added in v0.1.4
func (m *ClientState) XXX_Merge(src proto.Message)
func (*ClientState) XXX_Size ¶ added in v0.1.4
func (m *ClientState) XXX_Size() int
func (*ClientState) XXX_Unmarshal ¶ added in v0.1.4
func (m *ClientState) XXX_Unmarshal(b []byte) error
func (ClientState) ZeroCustomFields ¶ added in v0.1.4
func (cs ClientState) ZeroCustomFields() exported.ClientState
ZeroCustomFields returns the same client state since there are no custom fields in the 09-localhost client state.