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 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 (cs ClientState) CheckForMisbehaviour(_ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, ...) bool
- func (cs ClientState) CheckSubstituteAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore, _ sdk.KVStore, ...) 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(_ sdk.Context, clientStore sdk.KVStore, cdc codec.BinaryCodec, ...) (uint64, error)
- func (cs ClientState) Initialize(_ 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) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
- func (cs ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, ...) []exported.Height
- func (cs ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, ...)
- func (cs ClientState) Validate() error
- func (cs ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, ...) error
- func (cs *ClientState) VerifyMembership(ctx sdk.Context, clientStore sdk.KVStore, cdc codec.BinaryCodec, ...) error
- func (cs *ClientState) VerifyNonMembership(ctx sdk.Context, clientStore sdk.KVStore, cdc codec.BinaryCodec, ...) 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
- 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 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 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 ¶ added in v0.1.4
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces register the ibc channel submodule interfaces to protobuf Any.
func UnmarshalSignatureData ¶ added in v0.1.4
func UnmarshalSignatureData(cdc codec.BinaryCodec, data []byte) (signing.SignatureData, error)
func VerifySignature ¶ added in v0.1.4
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 AppModuleBasic ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
DefaultGenesis performs a no-op. Genesis is not supported for solo machine.
func (AppModuleBasic) GetQueryCmd ¶ added in v0.1.4
func (AppModuleBasic) GetQueryCmd() *cobra.Command
GetQueryCmd performs a no-op. Please see the 02-client cli commands.
func (AppModuleBasic) GetTxCmd ¶ added in v0.1.4
func (AppModuleBasic) GetTxCmd() *cobra.Command
GetTxCmd performs a no-op. Please see the 02-client cli commands.
func (AppModuleBasic) Name ¶ added in v0.1.4
func (AppModuleBasic) Name() string
Name returns the solo machine module name.
func (AppModuleBasic) RegisterGRPCGatewayRoutes ¶ added in v0.1.4
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
RegisterGRPCGatewayRoutes performs a no-op.
func (AppModuleBasic) RegisterInterfaces ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino)
RegisterLegacyAminoCodec performs a no-op. The solo machine client does not support amino.
func (AppModuleBasic) ValidateGenesis ¶ added in v0.1.4
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 ¶ added in v0.1.4
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 ¶ added in v0.1.4
func NewClientState(latestSequence uint64, consensusState *ConsensusState) *ClientState
NewClientState creates a new ClientState instance.
func (ClientState) CheckForMisbehaviour ¶ added in v0.1.4
func (cs ClientState) CheckForMisbehaviour(_ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, clientMsg exported.ClientMessage) bool
CheckForMisbehaviour returns true for type Misbehaviour (passed VerifyClientMessage check), otherwise returns false
func (ClientState) CheckSubstituteAndUpdateState ¶ added in v0.1.4
func (cs ClientState) CheckSubstituteAndUpdateState( ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore, _ sdk.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) ClientType ¶ added in v0.1.4
func (cs ClientState) ClientType() string
ClientType is Solo Machine.
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 since solomachine does not store any metadata in client store
func (ClientState) GetLatestHeight ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (cs ClientState) GetTimestampAtHeight( _ sdk.Context, clientStore sdk.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 v0.1.4
func (cs ClientState) Initialize(_ sdk.Context, cdc codec.BinaryCodec, clientStore sdk.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 ¶ 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 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 ¶ 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) UnpackInterfaces ¶ added in v0.1.4
func (cs ClientState) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (ClientState) UpdateState ¶ added in v0.1.4
func (cs ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.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 ¶ added in v0.1.4
func (cs ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.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 ¶ added in v0.1.4
func (cs ClientState) Validate() error
Validate performs basic validation of the client state fields.
func (ClientState) VerifyClientMessage ¶ added in v0.1.4
func (cs ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.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 ¶ added in v0.1.4
func (cs *ClientState) VerifyMembership( ctx sdk.Context, clientStore sdk.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 ¶ added in v0.1.4
func (cs *ClientState) VerifyNonMembership( ctx sdk.Context, clientStore sdk.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 v0.1.4
func (cs ClientState) VerifyUpgradeAndUpdateState( _ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.ClientState, _ exported.ConsensusState, _, _ []byte, ) error
VerifyUpgradeAndUpdateState returns an error since solomachine client does not support upgrades
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 is not implemented for solo machine
type ConsensusState ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (ConsensusState) ClientType() string
ClientType returns Solo Machine type.
func (*ConsensusState) Descriptor ¶ added in v0.1.4
func (*ConsensusState) Descriptor() ([]byte, []int)
func (ConsensusState) GetPubKey ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (cs ConsensusState) GetTimestamp() uint64
GetTimestamp returns zero.
func (*ConsensusState) Marshal ¶ added in v0.1.4
func (m *ConsensusState) Marshal() (dAtA []byte, err error)
func (*ConsensusState) MarshalTo ¶ added in v0.1.4
func (m *ConsensusState) MarshalTo(dAtA []byte) (int, error)
func (*ConsensusState) MarshalToSizedBuffer ¶ added in v0.1.4
func (m *ConsensusState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ConsensusState) ProtoMessage ¶ added in v0.1.4
func (*ConsensusState) ProtoMessage()
func (*ConsensusState) Reset ¶ added in v0.1.4
func (m *ConsensusState) Reset()
func (*ConsensusState) Size ¶ added in v0.1.4
func (m *ConsensusState) Size() (n int)
func (*ConsensusState) String ¶ added in v0.1.4
func (m *ConsensusState) String() string
func (*ConsensusState) Unmarshal ¶ added in v0.1.4
func (m *ConsensusState) Unmarshal(dAtA []byte) error
func (ConsensusState) UnpackInterfaces ¶ added in v0.1.4
func (cs ConsensusState) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (ConsensusState) ValidateBasic ¶ added in v0.1.4
func (cs ConsensusState) ValidateBasic() error
ValidateBasic defines basic validation for the solo machine consensus state.
func (*ConsensusState) XXX_DiscardUnknown ¶ added in v0.1.4
func (m *ConsensusState) XXX_DiscardUnknown()
func (*ConsensusState) XXX_Marshal ¶ added in v0.1.4
func (m *ConsensusState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ConsensusState) XXX_Merge ¶ added in v0.1.4
func (m *ConsensusState) XXX_Merge(src proto.Message)
func (*ConsensusState) XXX_Size ¶ added in v0.1.4
func (m *ConsensusState) XXX_Size() int
func (*ConsensusState) XXX_Unmarshal ¶ added in v0.1.4
func (m *ConsensusState) XXX_Unmarshal(b []byte) error
type Data ¶ added in v0.1.4
type Data interface{}
Data is an interface used for all the signature data bytes proto definitions.
type Header ¶ added in v0.1.4
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 ¶ added in v0.1.4
ClientType defines that the Header is a Solo Machine.
func (*Header) Descriptor ¶ added in v0.1.4
func (Header) GetPubKey ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (*Header) ProtoMessage ¶ added in v0.1.4
func (*Header) ProtoMessage()
func (Header) UnpackInterfaces ¶ added in v0.1.4
func (h Header) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (Header) ValidateBasic ¶ added in v0.1.4
ValidateBasic ensures that the timestamp, signature and public key have all been initialized.
func (*Header) XXX_DiscardUnknown ¶ added in v0.1.4
func (m *Header) XXX_DiscardUnknown()
func (*Header) XXX_Marshal ¶ added in v0.1.4
func (*Header) XXX_Unmarshal ¶ added in v0.1.4
type HeaderData ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (*HeaderData) Descriptor() ([]byte, []int)
func (*HeaderData) Marshal ¶ added in v0.1.4
func (m *HeaderData) Marshal() (dAtA []byte, err error)
func (*HeaderData) MarshalTo ¶ added in v0.1.4
func (m *HeaderData) MarshalTo(dAtA []byte) (int, error)
func (*HeaderData) MarshalToSizedBuffer ¶ added in v0.1.4
func (m *HeaderData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*HeaderData) ProtoMessage ¶ added in v0.1.4
func (*HeaderData) ProtoMessage()
func (*HeaderData) Reset ¶ added in v0.1.4
func (m *HeaderData) Reset()
func (*HeaderData) Size ¶ added in v0.1.4
func (m *HeaderData) Size() (n int)
func (*HeaderData) String ¶ added in v0.1.4
func (m *HeaderData) String() string
func (*HeaderData) Unmarshal ¶ added in v0.1.4
func (m *HeaderData) Unmarshal(dAtA []byte) error
func (HeaderData) UnpackInterfaces ¶ added in v0.1.4
func (hd HeaderData) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (*HeaderData) XXX_DiscardUnknown ¶ added in v0.1.4
func (m *HeaderData) XXX_DiscardUnknown()
func (*HeaderData) XXX_Marshal ¶ added in v0.1.4
func (m *HeaderData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HeaderData) XXX_Merge ¶ added in v0.1.4
func (m *HeaderData) XXX_Merge(src proto.Message)
func (*HeaderData) XXX_Size ¶ added in v0.1.4
func (m *HeaderData) XXX_Size() int
func (*HeaderData) XXX_Unmarshal ¶ added in v0.1.4
func (m *HeaderData) XXX_Unmarshal(b []byte) error
type Misbehaviour ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (misbehaviour Misbehaviour) ClientType() string
ClientType is a Solo Machine light client.
func (*Misbehaviour) Descriptor ¶ added in v0.1.4
func (*Misbehaviour) Descriptor() ([]byte, []int)
func (*Misbehaviour) Marshal ¶ added in v0.1.4
func (m *Misbehaviour) Marshal() (dAtA []byte, err error)
func (*Misbehaviour) MarshalTo ¶ added in v0.1.4
func (m *Misbehaviour) MarshalTo(dAtA []byte) (int, error)
func (*Misbehaviour) MarshalToSizedBuffer ¶ added in v0.1.4
func (m *Misbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Misbehaviour) ProtoMessage ¶ added in v0.1.4
func (*Misbehaviour) ProtoMessage()
func (*Misbehaviour) Reset ¶ added in v0.1.4
func (m *Misbehaviour) Reset()
func (*Misbehaviour) Size ¶ added in v0.1.4
func (m *Misbehaviour) Size() (n int)
func (*Misbehaviour) String ¶ added in v0.1.4
func (m *Misbehaviour) String() string
func (Misbehaviour) Type ¶ added in v0.1.4
func (misbehaviour Misbehaviour) Type() string
Type implements Misbehaviour interface.
func (*Misbehaviour) Unmarshal ¶ added in v0.1.4
func (m *Misbehaviour) Unmarshal(dAtA []byte) error
func (Misbehaviour) ValidateBasic ¶ added in v0.1.4
func (misbehaviour Misbehaviour) ValidateBasic() error
ValidateBasic implements Misbehaviour interface.
func (*Misbehaviour) XXX_DiscardUnknown ¶ added in v0.1.4
func (m *Misbehaviour) XXX_DiscardUnknown()
func (*Misbehaviour) XXX_Marshal ¶ added in v0.1.4
func (m *Misbehaviour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Misbehaviour) XXX_Merge ¶ added in v0.1.4
func (m *Misbehaviour) XXX_Merge(src proto.Message)
func (*Misbehaviour) XXX_Size ¶ added in v0.1.4
func (m *Misbehaviour) XXX_Size() int
func (*Misbehaviour) XXX_Unmarshal ¶ added in v0.1.4
func (m *Misbehaviour) XXX_Unmarshal(b []byte) error
type SignBytes ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (*SignBytes) MarshalToSizedBuffer ¶ added in v0.1.4
func (*SignBytes) ProtoMessage ¶ added in v0.1.4
func (*SignBytes) ProtoMessage()
func (*SignBytes) XXX_DiscardUnknown ¶ added in v0.1.4
func (m *SignBytes) XXX_DiscardUnknown()
func (*SignBytes) XXX_Marshal ¶ added in v0.1.4
func (*SignBytes) XXX_Unmarshal ¶ added in v0.1.4
type SignatureAndData ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (*SignatureAndData) Descriptor() ([]byte, []int)
func (*SignatureAndData) Marshal ¶ added in v0.1.4
func (m *SignatureAndData) Marshal() (dAtA []byte, err error)
func (*SignatureAndData) MarshalTo ¶ added in v0.1.4
func (m *SignatureAndData) MarshalTo(dAtA []byte) (int, error)
func (*SignatureAndData) MarshalToSizedBuffer ¶ added in v0.1.4
func (m *SignatureAndData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*SignatureAndData) ProtoMessage ¶ added in v0.1.4
func (*SignatureAndData) ProtoMessage()
func (*SignatureAndData) Reset ¶ added in v0.1.4
func (m *SignatureAndData) Reset()
func (*SignatureAndData) Size ¶ added in v0.1.4
func (m *SignatureAndData) Size() (n int)
func (*SignatureAndData) String ¶ added in v0.1.4
func (m *SignatureAndData) String() string
func (*SignatureAndData) Unmarshal ¶ added in v0.1.4
func (m *SignatureAndData) Unmarshal(dAtA []byte) error
func (SignatureAndData) ValidateBasic ¶ added in v0.1.4
func (sd SignatureAndData) ValidateBasic() error
ValidateBasic ensures that the signature and data fields are non-empty.
func (*SignatureAndData) XXX_DiscardUnknown ¶ added in v0.1.4
func (m *SignatureAndData) XXX_DiscardUnknown()
func (*SignatureAndData) XXX_Marshal ¶ added in v0.1.4
func (m *SignatureAndData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SignatureAndData) XXX_Merge ¶ added in v0.1.4
func (m *SignatureAndData) XXX_Merge(src proto.Message)
func (*SignatureAndData) XXX_Size ¶ added in v0.1.4
func (m *SignatureAndData) XXX_Size() int
func (*SignatureAndData) XXX_Unmarshal ¶ added in v0.1.4
func (m *SignatureAndData) XXX_Unmarshal(b []byte) error
type TimestampedSignatureData ¶ added in v0.1.4
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 ¶ added in v0.1.4
func (*TimestampedSignatureData) Descriptor() ([]byte, []int)
func (*TimestampedSignatureData) Marshal ¶ added in v0.1.4
func (m *TimestampedSignatureData) Marshal() (dAtA []byte, err error)
func (*TimestampedSignatureData) MarshalTo ¶ added in v0.1.4
func (m *TimestampedSignatureData) MarshalTo(dAtA []byte) (int, error)
func (*TimestampedSignatureData) MarshalToSizedBuffer ¶ added in v0.1.4
func (m *TimestampedSignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*TimestampedSignatureData) ProtoMessage ¶ added in v0.1.4
func (*TimestampedSignatureData) ProtoMessage()
func (*TimestampedSignatureData) Reset ¶ added in v0.1.4
func (m *TimestampedSignatureData) Reset()
func (*TimestampedSignatureData) Size ¶ added in v0.1.4
func (m *TimestampedSignatureData) Size() (n int)
func (*TimestampedSignatureData) String ¶ added in v0.1.4
func (m *TimestampedSignatureData) String() string
func (*TimestampedSignatureData) Unmarshal ¶ added in v0.1.4
func (m *TimestampedSignatureData) Unmarshal(dAtA []byte) error
func (*TimestampedSignatureData) XXX_DiscardUnknown ¶ added in v0.1.4
func (m *TimestampedSignatureData) XXX_DiscardUnknown()
func (*TimestampedSignatureData) XXX_Marshal ¶ added in v0.1.4
func (m *TimestampedSignatureData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TimestampedSignatureData) XXX_Merge ¶ added in v0.1.4
func (m *TimestampedSignatureData) XXX_Merge(src proto.Message)
func (*TimestampedSignatureData) XXX_Size ¶ added in v0.1.4
func (m *TimestampedSignatureData) XXX_Size() int
func (*TimestampedSignatureData) XXX_Unmarshal ¶ added in v0.1.4
func (m *TimestampedSignatureData) XXX_Unmarshal(b []byte) error