Documentation ¶
Overview ¶
Package solomachine implements a concrete ClientState, ConsensusState, Header and Misbehaviour types for the Solo Machine light client. This implementation is based off the ICS 06 specification (https://github.com/cosmos/ibc/tree/master/spec/client/ics-006-solo-machine-client)
Index ¶
- Constants
- Variables
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func UnmarshalSignatureData(cdc codec.BinaryCodec, data []byte) (signing.SignatureData, error)
- func VerifySignature(pubKey cryptotypes.PubKey, signBytes []byte, sigData signing.SignatureData) error
- type AppModule
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
- func (AppModuleBasic) GetQueryCmd() *cobra.Command
- func (AppModuleBasic) GetTxCmd() *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
- func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino)
- func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error
- type ClientState
- func (ClientState) CheckForMisbehaviour(_ sdk.Context, _ codec.BinaryCodec, _ storetypes.KVStore, ...) bool
- func (cs ClientState) CheckSubstituteAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, ...) error
- func (ClientState) ClientType() string
- func (*ClientState) Descriptor() ([]byte, []int)
- func (ClientState) ExportMetadata(_ storetypes.KVStore) []exported.GenesisMetadata
- func (cs ClientState) GetLatestHeight() exported.Height
- func (cs ClientState) GetTimestampAtHeight(_ sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, ...) (uint64, error)
- func (cs ClientState) Initialize(_ sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.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, _ storetypes.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) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, ...) []exported.Height
- func (cs ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, ...)
- func (cs ClientState) Validate() error
- func (cs ClientState) VerifyAggregateMembership(ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, ...) error
- func (cs ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, ...) error
- func (cs *ClientState) VerifyMembership(ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, ...) error
- func (cs *ClientState) VerifyNonMembership(ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, ...) error
- func (ClientState) VerifyUpgradeAndUpdateState(_ sdk.Context, _ codec.BinaryCodec, _ storetypes.KVStore, ...) 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 (ClientState) ZeroCustomFields() exported.ClientState
- type ConsensusState
- func (ConsensusState) ClientType() string
- func (*ConsensusState) Descriptor() ([]byte, []int)
- func (cs ConsensusState) GetPubKey() (cryptotypes.PubKey, error)
- 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 Data
- type Header
- func (Header) ClientType() string
- func (*Header) Descriptor() ([]byte, []int)
- func (h Header) GetPubKey() (cryptotypes.PubKey, error)
- 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) UnpackInterfaces(unpacker codectypes.AnyUnpacker) 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
- type HeaderData
- func (*HeaderData) Descriptor() ([]byte, []int)
- func (m *HeaderData) Marshal() (dAtA []byte, err error)
- func (m *HeaderData) MarshalTo(dAtA []byte) (int, error)
- func (m *HeaderData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*HeaderData) ProtoMessage()
- func (m *HeaderData) Reset()
- func (m *HeaderData) Size() (n int)
- func (m *HeaderData) String() string
- func (m *HeaderData) Unmarshal(dAtA []byte) error
- func (hd HeaderData) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
- func (m *HeaderData) XXX_DiscardUnknown()
- func (m *HeaderData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HeaderData) XXX_Merge(src proto.Message)
- func (m *HeaderData) XXX_Size() int
- func (m *HeaderData) XXX_Unmarshal(b []byte) error
- type Misbehaviour
- func (Misbehaviour) ClientType() string
- func (*Misbehaviour) Descriptor() ([]byte, []int)
- func (m *Misbehaviour) Marshal() (dAtA []byte, err error)
- func (m *Misbehaviour) MarshalTo(dAtA []byte) (int, error)
- func (m *Misbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Misbehaviour) ProtoMessage()
- func (m *Misbehaviour) Reset()
- func (m *Misbehaviour) Size() (n int)
- func (m *Misbehaviour) String() string
- func (Misbehaviour) Type() string
- func (m *Misbehaviour) Unmarshal(dAtA []byte) error
- func (misbehaviour Misbehaviour) ValidateBasic() error
- func (m *Misbehaviour) XXX_DiscardUnknown()
- func (m *Misbehaviour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Misbehaviour) XXX_Merge(src proto.Message)
- func (m *Misbehaviour) XXX_Size() int
- func (m *Misbehaviour) XXX_Unmarshal(b []byte) error
- type SignBytes
- func (*SignBytes) Descriptor() ([]byte, []int)
- func (m *SignBytes) Marshal() (dAtA []byte, err error)
- func (m *SignBytes) MarshalTo(dAtA []byte) (int, error)
- func (m *SignBytes) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SignBytes) ProtoMessage()
- func (m *SignBytes) Reset()
- func (m *SignBytes) Size() (n int)
- func (m *SignBytes) String() string
- func (m *SignBytes) Unmarshal(dAtA []byte) error
- func (m *SignBytes) XXX_DiscardUnknown()
- func (m *SignBytes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SignBytes) XXX_Merge(src proto.Message)
- func (m *SignBytes) XXX_Size() int
- func (m *SignBytes) XXX_Unmarshal(b []byte) error
- type SignatureAndData
- func (*SignatureAndData) Descriptor() ([]byte, []int)
- func (m *SignatureAndData) Marshal() (dAtA []byte, err error)
- func (m *SignatureAndData) MarshalTo(dAtA []byte) (int, error)
- func (m *SignatureAndData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SignatureAndData) ProtoMessage()
- func (m *SignatureAndData) Reset()
- func (m *SignatureAndData) Size() (n int)
- func (m *SignatureAndData) String() string
- func (m *SignatureAndData) Unmarshal(dAtA []byte) error
- func (sd SignatureAndData) ValidateBasic() error
- func (m *SignatureAndData) XXX_DiscardUnknown()
- func (m *SignatureAndData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SignatureAndData) XXX_Merge(src proto.Message)
- func (m *SignatureAndData) XXX_Size() int
- func (m *SignatureAndData) XXX_Unmarshal(b []byte) error
- type TimestampedSignatureData
- func (*TimestampedSignatureData) Descriptor() ([]byte, []int)
- func (m *TimestampedSignatureData) Marshal() (dAtA []byte, err error)
- func (m *TimestampedSignatureData) MarshalTo(dAtA []byte) (int, error)
- func (m *TimestampedSignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TimestampedSignatureData) ProtoMessage()
- func (m *TimestampedSignatureData) Reset()
- func (m *TimestampedSignatureData) Size() (n int)
- func (m *TimestampedSignatureData) String() string
- func (m *TimestampedSignatureData) Unmarshal(dAtA []byte) error
- func (m *TimestampedSignatureData) XXX_DiscardUnknown()
- func (m *TimestampedSignatureData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TimestampedSignatureData) XXX_Merge(src proto.Message)
- func (m *TimestampedSignatureData) XXX_Size() int
- func (m *TimestampedSignatureData) XXX_Unmarshal(b []byte) error
Constants ¶
const (
ModuleName = "06-solomachine"
)
const SentinelHeaderPath = "solomachine:header"
SentinelHeaderPath defines a placeholder path value used for headers in solomachine client updates
Variables ¶
var ( ErrInvalidHeader = errorsmod.Register(ModuleName, 2, "invalid header") ErrInvalidSequence = errorsmod.Register(ModuleName, 3, "invalid sequence") ErrInvalidSignatureAndData = errorsmod.Register(ModuleName, 4, "invalid signature and data") ErrSignatureVerificationFailed = errorsmod.Register(ModuleName, 5, "signature verification failed") ErrInvalidProof = errorsmod.Register(ModuleName, 6, "invalid solo machine proof") )
Functions ¶
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces register the ibc channel submodule interfaces to protobuf Any.
func UnmarshalSignatureData ¶
func UnmarshalSignatureData(cdc codec.BinaryCodec, data []byte) (signing.SignatureData, error)
func VerifySignature ¶
func VerifySignature(pubKey cryptotypes.PubKey, signBytes []byte, sigData signing.SignatureData) error
VerifySignature verifies if the the provided public key generated the signature over the given data. Single and Multi signature public keys are supported. The signature data type must correspond to the public key type. An error is returned if signature verification fails or an invalid SignatureData type is provided.
Types ¶
type AppModule ¶
type AppModule struct {
AppModuleBasic
}
AppModule is the application module for the Solomachine client module
func NewAppModule ¶
func NewAppModule() AppModule
NewAppModule creates a new Solomachine client module
func (AppModule) IsAppModule ¶
func (AppModule) IsAppModule()
IsAppModule implements the appmodule.AppModule interface.
func (AppModule) IsOnePerModuleType ¶
func (AppModule) IsOnePerModuleType()
IsOnePerModuleType implements the depinject.OnePerModuleType interface.
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic defines the basic application module used by the solo machine 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 solo machine.
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 solo machine 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 solo machine types.
func (AppModuleBasic) RegisterLegacyAminoCodec ¶
func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino)
RegisterLegacyAminoCodec performs a no-op. The solo machine 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 solo machine.
type ClientState ¶
type ClientState struct { // latest sequence of the client state Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` // frozen sequence of the solo machine IsFrozen bool `protobuf:"varint,2,opt,name=is_frozen,json=isFrozen,proto3" json:"is_frozen,omitempty"` ConsensusState *ConsensusState `protobuf:"bytes,3,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty"` }
ClientState defines a solo machine client that tracks the current consensus state and if the client is frozen.
func NewClientState ¶
func NewClientState(latestSequence uint64, consensusState *ConsensusState) *ClientState
NewClientState creates a new ClientState instance.
func (ClientState) CheckForMisbehaviour ¶
func (ClientState) CheckForMisbehaviour(_ sdk.Context, _ codec.BinaryCodec, _ storetypes.KVStore, clientMsg exported.ClientMessage) bool
CheckForMisbehaviour returns true for type Misbehaviour (passed VerifyClientMessage check), otherwise returns false
func (ClientState) CheckSubstituteAndUpdateState ¶
func (cs ClientState) CheckSubstituteAndUpdateState( ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore, _ storetypes.KVStore, substituteClient exported.ClientState, ) error
CheckSubstituteAndUpdateState verifies that the subject is allowed to be updated by a governance proposal and that the substitute client is a solo machine. It will update the consensus state to the substitute's consensus state and the sequence to the substitute's current sequence. An error is returned if the client has been disallowed to be updated by a governance proposal, the substitute is not a solo machine, or the current public key equals the new public key.
func (*ClientState) Descriptor ¶
func (*ClientState) Descriptor() ([]byte, []int)
func (ClientState) ExportMetadata ¶ added in v9.1.5
func (ClientState) ExportMetadata(_ storetypes.KVStore) []exported.GenesisMetadata
ExportMetadata is a no-op since solomachine does not store any metadata in client store
func (ClientState) GetLatestHeight ¶ added in v9.1.5
func (cs ClientState) GetLatestHeight() exported.Height
GetLatestHeight returns the latest sequence number. Return exported.Height to satisfy ClientState interface Revision number is always 0 for a solo-machine.
func (ClientState) GetTimestampAtHeight ¶
func (cs ClientState) GetTimestampAtHeight( _ sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, height exported.Height, ) (uint64, error)
GetTimestampAtHeight returns the timestamp in nanoseconds of the consensus state at the given height.
func (ClientState) Initialize ¶ added in v9.1.5
func (cs ClientState) Initialize(_ sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, consState exported.ConsensusState) error
Initialize checks that the initial consensus state is equal to the latest consensus state of the initial client and sets the client state in the provided client store.
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, _ storetypes.KVStore, _ codec.BinaryCodec) exported.Status
Status returns the status of the solo machine client. The client may be: - Active: if frozen sequence is 0 - Frozen: otherwise solo machine is frozen
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) UpdateState ¶
func (cs ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) []exported.Height
UpdateState updates the consensus state to the new public key and an incremented sequence. A list containing the updated consensus height is returned.
func (ClientState) UpdateStateOnMisbehaviour ¶
func (cs ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, _ exported.ClientMessage)
UpdateStateOnMisbehaviour updates state upon misbehaviour. This method should only be called on misbehaviour as it does not perform any misbehaviour checks.
func (ClientState) Validate ¶
func (cs ClientState) Validate() error
Validate performs basic validation of the client state fields.
func (ClientState) VerifyAggregateMembership ¶ added in v9.2.0
func (ClientState) VerifyClientMessage ¶
func (cs ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) error
VerifyClientMessage introspects the provided ClientMessage and checks its validity A Solomachine Header is considered valid if the currently registered public key has signed over the new public key with the correct sequence A Solomachine Misbehaviour is considered valid if duplicate signatures of the current public key are found on two different messages at a given sequence
func (*ClientState) VerifyMembership ¶
func (cs *ClientState) VerifyMembership( ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, _ exported.Height, delayTimePeriod uint64, delayBlockPeriod uint64, proof []byte, path exported.Path, value []byte, ) error
VerifyMembership is a generic proof verification method which verifies a proof of the existence of a value at a given CommitmentPath at the latest sequence. The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24).
func (*ClientState) VerifyNonMembership ¶
func (cs *ClientState) VerifyNonMembership( ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, _ exported.Height, delayTimePeriod uint64, delayBlockPeriod uint64, proof []byte, path exported.Path, ) error
VerifyNonMembership is a generic proof verification method which verifies the absence of a given CommitmentPath at the latest sequence. The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24).
func (ClientState) VerifyUpgradeAndUpdateState ¶ added in v9.1.5
func (ClientState) VerifyUpgradeAndUpdateState( _ sdk.Context, _ codec.BinaryCodec, _ storetypes.KVStore, _ exported.ClientState, _ exported.ConsensusState, _, _ []byte, ) error
VerifyUpgradeAndUpdateState returns an error since solomachine 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 ¶ added in v9.1.5
func (ClientState) ZeroCustomFields() exported.ClientState
ZeroCustomFields is not implemented for solo machine
type ConsensusState ¶
type ConsensusState struct { // public key of the solo machine PublicKey *types.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // diversifier allows the same public key to be re-used across different solo // machine clients (potentially on different chains) without being considered // misbehaviour. Diversifier string `protobuf:"bytes,2,opt,name=diversifier,proto3" json:"diversifier,omitempty"` Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` }
ConsensusState defines a solo machine consensus state. The sequence of a consensus state is contained in the "height" key used in storing the consensus state.
func (ConsensusState) ClientType ¶
func (ConsensusState) ClientType() string
ClientType returns Solo Machine type.
func (*ConsensusState) Descriptor ¶
func (*ConsensusState) Descriptor() ([]byte, []int)
func (ConsensusState) GetPubKey ¶
func (cs ConsensusState) GetPubKey() (cryptotypes.PubKey, error)
GetPubKey unmarshals the public key into a cryptotypes.PubKey type. An error is returned if the public key is nil or the cached value is not a PubKey.
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 solo machine 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 Data ¶
type Data interface{}
Data is an interface used for all the signature data bytes proto definitions.
type Header ¶
type Header struct { Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` NewPublicKey *types.Any `protobuf:"bytes,3,opt,name=new_public_key,json=newPublicKey,proto3" json:"new_public_key,omitempty"` NewDiversifier string `protobuf:"bytes,4,opt,name=new_diversifier,json=newDiversifier,proto3" json:"new_diversifier,omitempty"` }
Header defines a solo machine consensus header
func (Header) ClientType ¶
ClientType defines that the Header is a Solo Machine.
func (*Header) Descriptor ¶
func (Header) GetPubKey ¶
func (h Header) GetPubKey() (cryptotypes.PubKey, error)
GetPubKey unmarshals the new public key into a cryptotypes.PubKey type. An error is returned if the new public key is nil or the cached value is not a PubKey.
func (*Header) MarshalToSizedBuffer ¶
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (Header) UnpackInterfaces ¶
func (h Header) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (Header) ValidateBasic ¶
ValidateBasic ensures that the timestamp, signature and public key have all been initialized.
func (*Header) XXX_DiscardUnknown ¶
func (m *Header) XXX_DiscardUnknown()
func (*Header) XXX_Marshal ¶
func (*Header) XXX_Unmarshal ¶
type HeaderData ¶
type HeaderData struct { // header public key NewPubKey *types.Any `protobuf:"bytes,1,opt,name=new_pub_key,json=newPubKey,proto3" json:"new_pub_key,omitempty"` // header diversifier NewDiversifier string `protobuf:"bytes,2,opt,name=new_diversifier,json=newDiversifier,proto3" json:"new_diversifier,omitempty"` }
HeaderData returns the SignBytes data for update verification.
func (*HeaderData) Descriptor ¶
func (*HeaderData) Descriptor() ([]byte, []int)
func (*HeaderData) Marshal ¶
func (m *HeaderData) Marshal() (dAtA []byte, err error)
func (*HeaderData) MarshalToSizedBuffer ¶
func (m *HeaderData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*HeaderData) ProtoMessage ¶
func (*HeaderData) ProtoMessage()
func (*HeaderData) Reset ¶
func (m *HeaderData) Reset()
func (*HeaderData) Size ¶
func (m *HeaderData) Size() (n int)
func (*HeaderData) String ¶
func (m *HeaderData) String() string
func (*HeaderData) Unmarshal ¶
func (m *HeaderData) Unmarshal(dAtA []byte) error
func (HeaderData) UnpackInterfaces ¶
func (hd HeaderData) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (*HeaderData) XXX_DiscardUnknown ¶
func (m *HeaderData) XXX_DiscardUnknown()
func (*HeaderData) XXX_Marshal ¶
func (m *HeaderData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HeaderData) XXX_Merge ¶
func (m *HeaderData) XXX_Merge(src proto.Message)
func (*HeaderData) XXX_Size ¶
func (m *HeaderData) XXX_Size() int
func (*HeaderData) XXX_Unmarshal ¶
func (m *HeaderData) XXX_Unmarshal(b []byte) error
type Misbehaviour ¶
type Misbehaviour struct { Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` SignatureOne *SignatureAndData `protobuf:"bytes,2,opt,name=signature_one,json=signatureOne,proto3" json:"signature_one,omitempty"` SignatureTwo *SignatureAndData `protobuf:"bytes,3,opt,name=signature_two,json=signatureTwo,proto3" json:"signature_two,omitempty"` }
Misbehaviour defines misbehaviour for a solo machine which consists of a sequence and two signatures over different messages at that sequence.
func (Misbehaviour) ClientType ¶
func (Misbehaviour) ClientType() string
ClientType is a Solo Machine light client.
func (*Misbehaviour) Descriptor ¶
func (*Misbehaviour) Descriptor() ([]byte, []int)
func (*Misbehaviour) Marshal ¶
func (m *Misbehaviour) Marshal() (dAtA []byte, err 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) Type ¶
func (Misbehaviour) Type() string
Type implements Misbehaviour interface.
func (*Misbehaviour) Unmarshal ¶
func (m *Misbehaviour) Unmarshal(dAtA []byte) error
func (Misbehaviour) ValidateBasic ¶
func (misbehaviour Misbehaviour) ValidateBasic() error
ValidateBasic implements Misbehaviour interface.
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 SignBytes ¶
type SignBytes struct { // the sequence number Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` // the proof timestamp Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // the public key diversifier Diversifier string `protobuf:"bytes,3,opt,name=diversifier,proto3" json:"diversifier,omitempty"` // the standardised path bytes Path []byte `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` // the marshaled data bytes Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` }
SignBytes defines the signed bytes used for signature verification.
func (*SignBytes) Descriptor ¶
func (*SignBytes) MarshalToSizedBuffer ¶
func (*SignBytes) ProtoMessage ¶
func (*SignBytes) ProtoMessage()
func (*SignBytes) XXX_DiscardUnknown ¶
func (m *SignBytes) XXX_DiscardUnknown()
func (*SignBytes) XXX_Marshal ¶
func (*SignBytes) XXX_Unmarshal ¶
type SignatureAndData ¶
type SignatureAndData struct { Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` Path []byte `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` }
SignatureAndData contains a signature and the data signed over to create that signature.
func (*SignatureAndData) Descriptor ¶
func (*SignatureAndData) Descriptor() ([]byte, []int)
func (*SignatureAndData) Marshal ¶
func (m *SignatureAndData) Marshal() (dAtA []byte, err error)
func (*SignatureAndData) MarshalToSizedBuffer ¶
func (m *SignatureAndData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*SignatureAndData) ProtoMessage ¶
func (*SignatureAndData) ProtoMessage()
func (*SignatureAndData) Reset ¶
func (m *SignatureAndData) Reset()
func (*SignatureAndData) Size ¶
func (m *SignatureAndData) Size() (n int)
func (*SignatureAndData) String ¶
func (m *SignatureAndData) String() string
func (*SignatureAndData) Unmarshal ¶
func (m *SignatureAndData) Unmarshal(dAtA []byte) error
func (SignatureAndData) ValidateBasic ¶
func (sd SignatureAndData) ValidateBasic() error
ValidateBasic ensures that the signature and data fields are non-empty.
func (*SignatureAndData) XXX_DiscardUnknown ¶
func (m *SignatureAndData) XXX_DiscardUnknown()
func (*SignatureAndData) XXX_Marshal ¶
func (m *SignatureAndData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SignatureAndData) XXX_Merge ¶
func (m *SignatureAndData) XXX_Merge(src proto.Message)
func (*SignatureAndData) XXX_Size ¶
func (m *SignatureAndData) XXX_Size() int
func (*SignatureAndData) XXX_Unmarshal ¶
func (m *SignatureAndData) XXX_Unmarshal(b []byte) error
type TimestampedSignatureData ¶
type TimestampedSignatureData struct { SignatureData []byte `protobuf:"bytes,1,opt,name=signature_data,json=signatureData,proto3" json:"signature_data,omitempty"` Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` }
TimestampedSignatureData contains the signature data and the timestamp of the signature.
func (*TimestampedSignatureData) Descriptor ¶
func (*TimestampedSignatureData) Descriptor() ([]byte, []int)
func (*TimestampedSignatureData) Marshal ¶
func (m *TimestampedSignatureData) Marshal() (dAtA []byte, err error)
func (*TimestampedSignatureData) MarshalTo ¶
func (m *TimestampedSignatureData) MarshalTo(dAtA []byte) (int, error)
func (*TimestampedSignatureData) MarshalToSizedBuffer ¶
func (m *TimestampedSignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*TimestampedSignatureData) ProtoMessage ¶
func (*TimestampedSignatureData) ProtoMessage()
func (*TimestampedSignatureData) Reset ¶
func (m *TimestampedSignatureData) Reset()
func (*TimestampedSignatureData) Size ¶
func (m *TimestampedSignatureData) Size() (n int)
func (*TimestampedSignatureData) String ¶
func (m *TimestampedSignatureData) String() string
func (*TimestampedSignatureData) Unmarshal ¶
func (m *TimestampedSignatureData) Unmarshal(dAtA []byte) error
func (*TimestampedSignatureData) XXX_DiscardUnknown ¶
func (m *TimestampedSignatureData) XXX_DiscardUnknown()
func (*TimestampedSignatureData) XXX_Marshal ¶
func (m *TimestampedSignatureData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TimestampedSignatureData) XXX_Merge ¶
func (m *TimestampedSignatureData) XXX_Merge(src proto.Message)
func (*TimestampedSignatureData) XXX_Size ¶
func (m *TimestampedSignatureData) XXX_Size() int
func (*TimestampedSignatureData) XXX_Unmarshal ¶
func (m *TimestampedSignatureData) XXX_Unmarshal(b []byte) error