types

package
v0.0.0-...-201aeb4 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

View Source
const ProxyClientType string = "proxyclient"

Variables

View Source
var (
	ErrInvalidLengthProxy        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowProxy          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupProxy = fmt.Errorf("proto: unexpected end of group")
)

Functions

func NewProxyExtractorStore

func NewProxyExtractorStore(cdc codec.BinaryCodec, store sdk.KVStore) proxyExtractorStore

Types

type ClientState

type ClientState struct {
	// client state corresponding to proxy
	// the type must implements ClientState interface
	ProxyClientState *types.Any `protobuf:"bytes,1,opt,name=proxy_client_state,json=proxyClientState,proto3" json:"proxy_client_state,omitempty"`
	// client id corresponding to upstream on proxy
	UpstreamClientId string `protobuf:"bytes,2,opt,name=upstream_client_id,json=upstreamClientId,proto3" json:"upstream_client_id,omitempty"`
	// the proxy commitment prefix of the proxy chain.
	ProxyPrefix *types1.MerklePrefix `protobuf:"bytes,3,opt,name=proxy_prefix,json=proxyPrefix,proto3" json:"proxy_prefix,omitempty"`
	// the ibc commitment prefix of the proxy chain
	IbcPrefix *types1.MerklePrefix `protobuf:"bytes,4,opt,name=ibc_prefix,json=ibcPrefix,proto3" json:"ibc_prefix,omitempty"`
}

func NewClientState

func NewClientState(upstreamClientID string) *ClientState

func (ClientState) CheckHeaderAndUpdateState

func (cs ClientState) CheckHeaderAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, header exported.Header) (exported.ClientState, exported.ConsensusState, error)

Update and Misbehaviour functions

func (*ClientState) CheckMisbehaviourAndUpdateState

func (cs *ClientState) CheckMisbehaviourAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, store sdk.KVStore, misbehaviour exported.Misbehaviour) (exported.ClientState, error)

func (*ClientState) CheckSubstituteAndUpdateState

func (cs *ClientState) CheckSubstituteAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore sdk.KVStore, substituteClientStore sdk.KVStore, substituteClient exported.ClientState) (exported.ClientState, error)

func (*ClientState) ClientType

func (cs *ClientState) ClientType() string

func (*ClientState) Descriptor

func (*ClientState) Descriptor() ([]byte, []int)

func (*ClientState) ExportMetadata

func (cs *ClientState) ExportMetadata(store sdk.KVStore) []exported.GenesisMetadata

Genesis function

func (*ClientState) GetLatestHeight

func (cs *ClientState) GetLatestHeight() exported.Height

func (*ClientState) GetProofSpecs

func (cs *ClientState) GetProofSpecs() []*ics23.ProofSpec

func (*ClientState) GetProxyClientState

func (cs *ClientState) GetProxyClientState() exported.ClientState

func (*ClientState) IBCVerifyClientConsensusState

func (cs *ClientState) IBCVerifyClientConsensusState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, counterpartyClientIdentifier string, consensusHeight exported.Height, prefix exported.Prefix, proof []byte, consensusState exported.ConsensusState) error

IBC verification function

func (*ClientState) IBCVerifyClientState

func (cs *ClientState) IBCVerifyClientState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, prefix exported.Prefix, counterpartyClientIdentifier string, proof []byte, clientState exported.ClientState) error

IBC verification function

func (*ClientState) Initialize

func (cs *ClientState) Initialize(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, consState exported.ConsensusState) error

Initialization function Clients must validate the initial consensus state, and may store any client-specific metadata necessary for correct light client operation

func (*ClientState) IsInitialized

func (cs *ClientState) IsInitialized() bool

func (*ClientState) Marshal

func (m *ClientState) Marshal() (dAtA []byte, err error)

func (*ClientState) MarshalTo

func (m *ClientState) MarshalTo(dAtA []byte) (int, 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(
	ctx sdk.Context,
	clientStore sdk.KVStore,
	cdc codec.BinaryCodec,
) exported.Status

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 UnpackInterfacesMessage.UnpackInterfaces

func (*ClientState) Validate

func (cs *ClientState) Validate() error

func (*ClientState) VerifyChannelState

func (cs *ClientState) VerifyChannelState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, prefix exported.Prefix, proof []byte, portID string, channelID string, channel exported.ChannelI) error

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

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

State verification functions

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

func (*ClientState) VerifyNextSequenceRecv

func (cs *ClientState) VerifyNextSequenceRecv(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, currentTimestamp uint64, delayPeriod uint64, prefix exported.Prefix, proof []byte, portID string, channelID string, nextSequenceRecv uint64) error

func (*ClientState) VerifyPacketAcknowledgement

func (cs *ClientState) VerifyPacketAcknowledgement(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, currentTimestamp uint64, delayPeriod uint64, prefix exported.Prefix, proof []byte, portID string, channelID string, sequence uint64, acknowledgement []byte) error

func (*ClientState) VerifyPacketCommitment

func (cs *ClientState) VerifyPacketCommitment(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, currentTimestamp uint64, delayPeriod uint64, prefix exported.Prefix, proof []byte, portID string, channelID string, sequence uint64, commitmentBytes []byte) error

func (*ClientState) VerifyPacketReceiptAbsence

func (cs *ClientState) VerifyPacketReceiptAbsence(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height, currentTimestamp uint64, delayPeriod uint64, prefix exported.Prefix, proof []byte, portID string, channelID string, sequence uint64) error

func (*ClientState) VerifyUpgradeAndUpdateState

func (cs *ClientState) VerifyUpgradeAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, store sdk.KVStore, newClient exported.ClientState, newConsState exported.ConsensusState, proofUpgradeClient []byte, proofUpgradeConsState []byte) (exported.ClientState, exported.ConsensusState, error)

Upgrade functions NOTE: proof heights are not included as upgrade to a new revision is expected to pass only on the last height committed by the current revision. Clients are responsible for ensuring that the planned last height of the current revision is somehow encoded in the proof verification process. This is to ensure that no premature upgrades occur, since upgrade plans committed to by the counterparty may be cancelled or modified before the last planned height.

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

Utility function that zeroes out any client customizable fields in client state Ledger enforced fields are maintained while all custom fields are zero values Used to verify upgrades

type ConsensusState

type ConsensusState struct {
	// consensus state corresponding to proxy
	// the type must implements ConsensusState interface
	ProxyConsensusState *types.Any `protobuf:"bytes,1,opt,name=proxy_consensus_state,json=proxyConsensusState,proto3" json:"proxy_consensus_state,omitempty"`
}

func GetConsensusState

func GetConsensusState(store sdk.KVStore, cdc codec.BinaryCodec, height exported.Height) (*ConsensusState, error)

GetConsensusState retrieves the consensus state from the client prefixed store. An error is returned if the consensus state does not exist.

func NewConsensusState

func NewConsensusState(consensusState *codectypes.Any) *ConsensusState

func (*ConsensusState) ClientType

func (cs *ConsensusState) ClientType() string

func (*ConsensusState) Descriptor

func (*ConsensusState) Descriptor() ([]byte, []int)

func (*ConsensusState) GetProxyConsensusState

func (cs *ConsensusState) GetProxyConsensusState() exported.ConsensusState

func (*ConsensusState) GetRoot

func (cs *ConsensusState) GetRoot() exported.Root

GetRoot returns the commitment root of the consensus state, which is used for key-value pair verification.

func (*ConsensusState) GetTimestamp

func (cs *ConsensusState) GetTimestamp() uint64

GetTimestamp returns the timestamp (in nanoseconds) of the consensus state

func (*ConsensusState) Marshal

func (m *ConsensusState) Marshal() (dAtA []byte, err error)

func (*ConsensusState) MarshalTo

func (m *ConsensusState) MarshalTo(dAtA []byte) (int, 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 UnpackInterfacesMessage.UnpackInterfaces

func (*ConsensusState) ValidateBasic

func (cs *ConsensusState) ValidateBasic() error

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

Jump to

Keyboard shortcuts

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