types

package
v7.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthWasm        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowWasm          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupWasm = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces registers the tendermint concrete client-related implementations and interfaces.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

Types

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic defines the basic application module used by the tendermint light client. Only the RegisterInterfaces function needs to be implemented. All other function perform a no-op.

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage

DefaultGenesis performs a no-op. Genesis is not supported for the tendermint light client.

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd() *cobra.Command

GetQueryCmd performs a no-op. Please see the 02-client cli commands.

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd() *cobra.Command

GetTxCmd performs a no-op. Please see the 02-client cli commands.

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name returns the tendermint module name.

func (AppModuleBasic) RegisterGRPCGatewayRoutes

func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)

RegisterGRPCGatewayRoutes performs a no-op.

func (AppModuleBasic) RegisterInterfaces

func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces registers module concrete types into protobuf Any. This allows core IBC to unmarshal wasm light client types.

func (AppModuleBasic) RegisterLegacyAminoCodec

func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino)

RegisterLegacyAminoCodec performs a no-op. The Wasm client does not support amino.

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error

ValidateGenesis performs a no-op. Genesis is not supported for the tendermint light cilent.

type ClientState

type ClientState struct {
	Data         []byte       `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	CodeId       []byte       `protobuf:"bytes,2,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
	LatestHeight types.Height `protobuf:"bytes,3,opt,name=latest_height,json=latestHeight,proto3" json:"latest_height" yaml:"latest_height"`
}

Wasm light client's Client state

func NewClientState

func NewClientState(latestSequence uint64, consensusState *ConsensusState) *ClientState

NewClientState creates a new ClientState instance.

func (ClientState) CheckForMisbehaviour

func (c ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, msg exported.ClientMessage) bool

func (ClientState) CheckSubstituteAndUpdateState

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

func (ClientState) ClientType

func (c ClientState) ClientType() string

func (*ClientState) Descriptor

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

func (ClientState) ExportMetadata

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

func (ClientState) GetLatestHeight

func (c ClientState) GetLatestHeight() exported.Height

func (ClientState) GetTimestampAtHeight

func (c ClientState) GetTimestampAtHeight(
	ctx sdk.Context,
	clientStore sdk.KVStore,
	cdc codec.BinaryCodec,
	height exported.Height,
) (uint64, error)

func (ClientState) Initialize

func (c ClientState) Initialize(context sdk.Context, marshaler codec.BinaryCodec, store sdk.KVStore, state exported.ConsensusState) error

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 (c ClientState) Status(ctx sdk.Context, store 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) UpdateState

func (c ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) []exported.Height

func (ClientState) UpdateStateOnMisbehaviour

func (c ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage)

UpdateStateOnMisbehaviour should perform appropriate state changes on a client state given that misbehaviour has been detected and verified

func (ClientState) Validate

func (c ClientState) Validate() error

func (ClientState) VerifyClientMessage

func (c ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) error

VerifyClientMessage must verify a ClientMessage. A ClientMessage could be a Header, Misbehaviour, or batch update. It must handle each type of ClientMessage appropriately. Calls to CheckForMisbehaviour, UpdateState, and UpdateStateOnMisbehaviour will assume that the content of the ClientMessage has been verified and can be trusted. An error should be returned if the ClientMessage fails to verify.

func (ClientState) VerifyMembership

func (c ClientState) VerifyMembership(
	ctx sdk.Context,
	clientStore sdk.KVStore,
	cdc codec.BinaryCodec,
	height exported.Height,
	delayTimePeriod uint64,
	delayBlockPeriod uint64,
	proof []byte,
	path exported.Path,
	value []byte,
) error

func (ClientState) VerifyNonMembership

func (c ClientState) VerifyNonMembership(
	ctx sdk.Context,
	clientStore sdk.KVStore,
	cdc codec.BinaryCodec,
	height exported.Height,
	delayTimePeriod uint64,
	delayBlockPeriod uint64,
	proof []byte,
	path exported.Path,
) error

func (ClientState) VerifyUpgradeAndUpdateState

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

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 (c ClientState) ZeroCustomFields() exported.ClientState

type ConsensusState

type ConsensusState struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// timestamp that corresponds to the block height in which the ConsensusState
	// was stored.
	Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
}

Wasm light client's ConsensusState

func (ConsensusState) ClientType

func (m ConsensusState) ClientType() string

func (*ConsensusState) Descriptor

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

func (ConsensusState) GetTimestamp

func (m ConsensusState) GetTimestamp() uint64

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) ValidateBasic

func (m 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
type Header struct {
	Data   []byte       `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Height types.Height `protobuf:"bytes,2,opt,name=height,proto3" json:"height" yaml:"height"`
}

Wasm light client Header

func (Header) ClientType

func (m Header) ClientType() string

func (*Header) Descriptor

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

func (*Header) Marshal

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

func (*Header) MarshalTo

func (m *Header) MarshalTo(dAtA []byte) (int, error)

func (*Header) MarshalToSizedBuffer

func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) Reset

func (m *Header) Reset()

func (*Header) Size

func (m *Header) Size() (n int)

func (*Header) String

func (m *Header) String() string

func (*Header) Unmarshal

func (m *Header) Unmarshal(dAtA []byte) error

func (Header) ValidateBasic

func (m Header) ValidateBasic() error

func (*Header) XXX_DiscardUnknown

func (m *Header) XXX_DiscardUnknown()

func (*Header) XXX_Marshal

func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Header) XXX_Merge

func (m *Header) XXX_Merge(src proto.Message)

func (*Header) XXX_Size

func (m *Header) XXX_Size() int

func (*Header) XXX_Unmarshal

func (m *Header) XXX_Unmarshal(b []byte) error

type Misbehaviour

type Misbehaviour struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}

Wasm light client Misbehaviour

func (Misbehaviour) ClientType

func (m Misbehaviour) ClientType() string

func (*Misbehaviour) Descriptor

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

func (*Misbehaviour) Marshal

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

func (*Misbehaviour) MarshalTo

func (m *Misbehaviour) MarshalTo(dAtA []byte) (int, error)

func (*Misbehaviour) MarshalToSizedBuffer

func (m *Misbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Misbehaviour) ProtoMessage

func (*Misbehaviour) ProtoMessage()

func (*Misbehaviour) Reset

func (m *Misbehaviour) Reset()

func (*Misbehaviour) Size

func (m *Misbehaviour) Size() (n int)

func (*Misbehaviour) String

func (m *Misbehaviour) String() string

func (*Misbehaviour) Unmarshal

func (m *Misbehaviour) Unmarshal(dAtA []byte) error

func (Misbehaviour) ValidateBasic

func (m Misbehaviour) ValidateBasic() error

func (*Misbehaviour) XXX_DiscardUnknown

func (m *Misbehaviour) XXX_DiscardUnknown()

func (*Misbehaviour) XXX_Marshal

func (m *Misbehaviour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Misbehaviour) XXX_Merge

func (m *Misbehaviour) XXX_Merge(src proto.Message)

func (*Misbehaviour) XXX_Size

func (m *Misbehaviour) XXX_Size() int

func (*Misbehaviour) XXX_Unmarshal

func (m *Misbehaviour) XXX_Unmarshal(b []byte) error

type MsgClient

type MsgClient interface {
	// StoreCode defines a rpc handler method for MsgStoreCode.
	StoreCode(ctx context.Context, in *MsgStoreCode, opts ...grpc.CallOption) (*MsgStoreCodeResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer

type MsgServer interface {
	// StoreCode defines a rpc handler method for MsgStoreCode.
	StoreCode(context.Context, *MsgStoreCode) (*MsgStoreCodeResponse, error)
}

MsgServer is the server API for Msg service.

type MsgStoreCode

type MsgStoreCode struct {
	Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"`
	Code   []byte `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
}

MsgStoreCode defines the request type for the StoreCode rpc.

func (*MsgStoreCode) Descriptor

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

func (*MsgStoreCode) GetCode

func (m *MsgStoreCode) GetCode() []byte

func (*MsgStoreCode) GetSigner

func (m *MsgStoreCode) GetSigner() string

func (MsgStoreCode) GetSigners

func (m MsgStoreCode) GetSigners() []sdk.AccAddress

func (*MsgStoreCode) Marshal

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

func (*MsgStoreCode) MarshalTo

func (m *MsgStoreCode) MarshalTo(dAtA []byte) (int, error)

func (*MsgStoreCode) MarshalToSizedBuffer

func (m *MsgStoreCode) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgStoreCode) ProtoMessage

func (*MsgStoreCode) ProtoMessage()

func (*MsgStoreCode) Reset

func (m *MsgStoreCode) Reset()

func (*MsgStoreCode) Size

func (m *MsgStoreCode) Size() (n int)

func (*MsgStoreCode) String

func (m *MsgStoreCode) String() string

func (*MsgStoreCode) Unmarshal

func (m *MsgStoreCode) Unmarshal(dAtA []byte) error

func (MsgStoreCode) ValidateBasic

func (m MsgStoreCode) ValidateBasic() error

func (*MsgStoreCode) XXX_DiscardUnknown

func (m *MsgStoreCode) XXX_DiscardUnknown()

func (*MsgStoreCode) XXX_Marshal

func (m *MsgStoreCode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgStoreCode) XXX_Merge

func (m *MsgStoreCode) XXX_Merge(src proto.Message)

func (*MsgStoreCode) XXX_Size

func (m *MsgStoreCode) XXX_Size() int

func (*MsgStoreCode) XXX_Unmarshal

func (m *MsgStoreCode) XXX_Unmarshal(b []byte) error

type MsgStoreCodeResponse

type MsgStoreCodeResponse struct {
	CodeId []byte `protobuf:"bytes,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
}

MsgStoreCodeResponse defines the response type for the StoreCode rpc

func (*MsgStoreCodeResponse) Descriptor

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

func (*MsgStoreCodeResponse) GetCodeId

func (m *MsgStoreCodeResponse) GetCodeId() []byte

func (*MsgStoreCodeResponse) Marshal

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

func (*MsgStoreCodeResponse) MarshalTo

func (m *MsgStoreCodeResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgStoreCodeResponse) MarshalToSizedBuffer

func (m *MsgStoreCodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgStoreCodeResponse) ProtoMessage

func (*MsgStoreCodeResponse) ProtoMessage()

func (*MsgStoreCodeResponse) Reset

func (m *MsgStoreCodeResponse) Reset()

func (*MsgStoreCodeResponse) Size

func (m *MsgStoreCodeResponse) Size() (n int)

func (*MsgStoreCodeResponse) String

func (m *MsgStoreCodeResponse) String() string

func (*MsgStoreCodeResponse) Unmarshal

func (m *MsgStoreCodeResponse) Unmarshal(dAtA []byte) error

func (*MsgStoreCodeResponse) XXX_DiscardUnknown

func (m *MsgStoreCodeResponse) XXX_DiscardUnknown()

func (*MsgStoreCodeResponse) XXX_Marshal

func (m *MsgStoreCodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgStoreCodeResponse) XXX_Merge

func (m *MsgStoreCodeResponse) XXX_Merge(src proto.Message)

func (*MsgStoreCodeResponse) XXX_Size

func (m *MsgStoreCodeResponse) XXX_Size() int

func (*MsgStoreCodeResponse) XXX_Unmarshal

func (m *MsgStoreCodeResponse) XXX_Unmarshal(b []byte) error

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) StoreCode

Jump to

Keyboard shortcuts

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