types

package
v0.0.0-...-8dbda12 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 40 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ModuleName defines the Harmony client name
	ModuleName    string = "ibc-harmony"
	HarmonyClient string = "ibc-harmony"

	// KVStore key prefixes for IBC
	KeyEpochStatePrefix string = "epochStates"
)
View Source
const AccountStorageRootIndex = 2

Variables

View Source
var (
	ErrEpochStateNotFound    = sdkerrors.Register(ModuleName, 1, "epoch state not found")
	ErrInvalidProof          = sdkerrors.Register(ModuleName, 2, "invalid proof")
	ErrInvalidSignature      = sdkerrors.Register(ModuleName, 3, "invalid signature")
	ErrTrustingPeriodExpired = sdkerrors.Register(ModuleName, 4, "time since trusted state has passed the trusting period")
)

Harmony client sentinel errors

View Source
var (
	ErrInvalidLengthHarmony        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowHarmony          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupHarmony = fmt.Errorf("proto: unexpected end of group")
)

Functions

func ChannelCommitmentKey

func ChannelCommitmentKey(portId, channelId string) ([]byte, error)

func ChannelCommitmentSlot

func ChannelCommitmentSlot(portId, channelId string) ([]byte, error)

func ClientCommitmentKey

func ClientCommitmentKey(clientId string) ([]byte, error)

func ClientStateCommitmentSlot

func ClientStateCommitmentSlot(clientId string) ([]byte, error)

func ConnectionCommitmentKey

func ConnectionCommitmentKey(connectionId string) ([]byte, error)

func ConnectionCommitmentSlot

func ConnectionCommitmentSlot(connectionId string) ([]byte, error)

func ConsensusCommitmentKey

func ConsensusCommitmentKey(clientId string, height exported.Height) ([]byte, error)

func ConsensusStateCommitmentSlot

func ConsensusStateCommitmentSlot(clientId string, height exported.Height) ([]byte, error)

func ConstructCommitPayload

func ConstructCommitPayload(blockHash common.Hash, blockNum, viewID uint64) []byte

ConstructCommitPayload returns the commit payload for consensus signatures. We assume that it is after StakingEpoch.

func EpochStateKey

func EpochStateKey(epoch uint64) []byte

func EpochStatePath

func EpochStatePath(epoch uint64) string

func NextSequenceRecvCommitmentKey

func NextSequenceRecvCommitmentKey(portId, channelId string) ([]byte, error)

func NextSequenceRecvCommitmentSlot

func NextSequenceRecvCommitmentSlot(portId, channelId string) ([]byte, error)

func PacketAcknowledgementCommitmentKey

func PacketAcknowledgementCommitmentKey(portId, channelId string, sequence uint64) ([]byte, error)

func PacketAcknowledgementCommitmentSlot

func PacketAcknowledgementCommitmentSlot(portId, channelId string, sequence uint64) ([]byte, error)

func PacketCommitmentKey

func PacketCommitmentKey(portId, channelId string, sequence uint64) ([]byte, error)

func PacketCommitmentSlot

func PacketCommitmentSlot(portId, channelId string, sequence uint64) ([]byte, error)

func PacketReceiptCommitmentKey

func PacketReceiptCommitmentKey(portId, channelId string, sequence uint64) ([]byte, error)

func PacketReceiptCommitmentSlot

func PacketReceiptCommitmentSlot(portId, channelId string, sequence uint64) ([]byte, error)

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces register the ibc channel submodule interfaces to protobuf Any.

func SetConsensusState

func SetConsensusState(clientStore sdk.KVStore, cdc codec.BinaryCodec, consensusState *ConsensusState, height exported.Height)

SetConsensusState stores the consensus state at the given height.

func SetEpochState

func SetEpochState(clientStore sdk.KVStore, cdc codec.BinaryCodec, epochState *EpochState, epoch uint64)

SetEpochState stores the epoch state at the given epoch.

func Verify

func Verify(rootHash common.Hash, key []byte, value []byte, proof [][]byte) error

Verify verifies that the path generated from key, following the nodes in proof leads to a leaf with value, where the hashes are correct up to the rootHash. WARNING: When the value is not found, `eth_getProof` will return "0x0" at the StorageProof `value` field. In order to verify the proof of non existence, you must set `value` to nil, *not* the RLP encoding of 0 or null (which would be 0x80).

func VerifyCommitSig

func VerifyCommitSig(
	beaconHeader *v3.Header,
	committee *shard.Committee,
	commitSig, commitBitmap []byte,
) error

func VerifyProof

func VerifyProof(rootHash common.Hash, key []byte, proof [][]byte) ([]byte, error)

func VerifyStorageProof

func VerifyStorageProof(storageHash common.Hash, key, value []byte, proof [][]byte) error

VerifyStorageProof verifies an Ethereum storage proof against the StateRoot. It does not verify the account proof against the Ethereum StateHash. For absence proof, set nil to `value`.

Types

type BeaconHeader

type BeaconHeader struct {
	Header       []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	CommitSig    []byte `protobuf:"bytes,2,opt,name=commit_sig,json=commitSig,proto3" json:"commit_sig,omitempty"`
	CommitBitmap []byte `protobuf:"bytes,3,opt,name=commit_bitmap,json=commitBitmap,proto3" json:"commit_bitmap,omitempty"`
}

func (*BeaconHeader) Descriptor

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

func (*BeaconHeader) Marshal

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

func (*BeaconHeader) MarshalTo

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

func (*BeaconHeader) MarshalToSizedBuffer

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

func (*BeaconHeader) ProtoMessage

func (*BeaconHeader) ProtoMessage()

func (*BeaconHeader) Reset

func (m *BeaconHeader) Reset()

func (*BeaconHeader) Size

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

func (*BeaconHeader) String

func (m *BeaconHeader) String() string

func (*BeaconHeader) Unmarshal

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

func (*BeaconHeader) XXX_DiscardUnknown

func (m *BeaconHeader) XXX_DiscardUnknown()

func (*BeaconHeader) XXX_Marshal

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

func (*BeaconHeader) XXX_Merge

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

func (*BeaconHeader) XXX_Size

func (m *BeaconHeader) XXX_Size() int

func (*BeaconHeader) XXX_Unmarshal

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

type ClientState

type ClientState struct {
	ShardId         uint32 `protobuf:"varint,1,opt,name=shard_id,json=shardId,proto3" json:"shard_id,omitempty"`
	ContractAddress []byte `protobuf:"bytes,2,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"`
	LatestEpoch     uint64 `protobuf:"varint,3,opt,name=latest_epoch,json=latestEpoch,proto3" json:"latest_epoch,omitempty"`
	// Beacon committee
	LatestCommittee []byte `protobuf:"bytes,4,opt,name=latest_committee,json=latestCommittee,proto3" json:"latest_committee,omitempty"`
	// Latest height indicates a height for the shard chain
	LatestHeight   types.Height  `protobuf:"bytes,5,opt,name=latest_height,json=latestHeight,proto3" json:"latest_height"`
	TrustingPeriod time.Duration `` /* 128-byte string literal not displayed */
	Frozen         bool          `protobuf:"varint,7,opt,name=frozen,proto3" json:"frozen,omitempty"`
}

func NewClientState

func NewClientState() *ClientState

func (ClientState) CheckBeaconMisbehaviour

func (cs ClientState) CheckBeaconMisbehaviour(
	ctx sdk.Context,
	cdc codec.BinaryCodec,
	clientStore sdk.KVStore,
	misbehaviour *Misbehaviour,
) error

CheckBeaconMisbehaviour checks the existence of two different valid beacon headers for the same beacon block number. It validates each header with the aggregated signature and its bitmap of the committee for the respective epoch.

func (ClientState) CheckHeaderAndUpdateState

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

CheckHeaderAndUpdateState verifies that: - the beacon header with the associated committee signature and bitmap. It also verifies the quorum using the committee of the target epoch. - (for shard 1+) the shard header with the cross-link of the beacon header. If the target header's epoch is older than the epoch of ClientState, `header` must have "epoch header(s)", which is/are the last beacon header(s) of each epoch for updating epoch of ClientState.

func (ClientState) CheckMisbehaviourAndUpdateState

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

CheckMisbehaviourAndUpdateState detects the following as Misbehaviour:

1. The existence of two different valid beacon headers for the same beacon block number 2. The existence of two different valid shard headers for the same shard ID and block number:

func (ClientState) CheckShardMisbehaviour

func (cs ClientState) CheckShardMisbehaviour(
	ctx sdk.Context,
	cdc codec.BinaryCodec,
	clientStore sdk.KVStore,
	misbehaviour *Misbehaviour,
) error

CheckShardMisbehaviour checks for a case where two different shard headers with the same block number are submitted. Both shard headers assume the existence of a corresponding beacon header with a valid cross-link; a shard header without a cross-link is invalid in Harmony, and this light client does not accept it.

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)

Future work is needed

func (ClientState) ClientType

func (cs ClientState) ClientType() string

func (*ClientState) Descriptor

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

func (ClientState) ExportMetadata

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

Genesis function

func (ClientState) GetCommittee

func (cs ClientState) GetCommittee() *shard.Committee

func (ClientState) GetLatestHeight

func (cs ClientState) GetLatestHeight() exported.Height

func (ClientState) GetProofSpecs

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

func (ClientState) Initialize

func (cs ClientState) Initialize(ctx sdk.Context, cdc codec.BinaryCodec, store 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) IsExpired

func (cs ClientState) IsExpired(latestTimestamp, now time.Time) bool

IsExpired returns whether or not the client has passed the trusting period since the last update (in which case no headers are considered valid).

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

func (cs *ClientState) SetCommittee(committee *shard.Committee)

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

Status function Clients must return their status. Only Active clients are allowed to process packets.

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) 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, delayTimePeriod uint64, delayBlockPeriod 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, delayTimePeriod uint64, delayBlockPeriod 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, delayTimePeriod uint64, delayBlockPeriod 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, delayTimePeriod uint64, delayBlockPeriod 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)

Future work is needed

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 {
	// Beacon timestamp
	Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Root      []byte `protobuf:"bytes,2,opt,name=root,proto3" json:"root,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 (ConsensusState) ClientType

func (cs ConsensusState) ClientType() string

func (*ConsensusState) Descriptor

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

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 the UnpackInterfaceMessages.UnpackInterfaces method

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

type EpochState

type EpochState struct {
	// Beacon committee
	Committee []byte `protobuf:"bytes,1,opt,name=committee,proto3" json:"committee,omitempty"`
}

func GetEpochState

func GetEpochState(clientStore sdk.KVStore, cdc codec.BinaryCodec, epoch uint64) (*EpochState, error)

GetEpochState retrieves the `epoch` state from the client prefixed store. An error is returned if the epoch state does not exist.

func (*EpochState) Descriptor

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

func (EpochState) GetCommittee

func (es EpochState) GetCommittee() *shard.Committee

func (*EpochState) Marshal

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

func (*EpochState) MarshalTo

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

func (*EpochState) MarshalToSizedBuffer

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

func (*EpochState) ProtoMessage

func (*EpochState) ProtoMessage()

func (*EpochState) Reset

func (m *EpochState) Reset()

func (*EpochState) Size

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

func (*EpochState) String

func (m *EpochState) String() string

func (*EpochState) Unmarshal

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

func (*EpochState) XXX_DiscardUnknown

func (m *EpochState) XXX_DiscardUnknown()

func (*EpochState) XXX_Marshal

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

func (*EpochState) XXX_Merge

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

func (*EpochState) XXX_Size

func (m *EpochState) XXX_Size() int

func (*EpochState) XXX_Unmarshal

func (m *EpochState) XXX_Unmarshal(b []byte) error
type Header struct {
	ShardHeader    []byte         `protobuf:"bytes,1,opt,name=shard_header,json=shardHeader,proto3" json:"shard_header,omitempty"`
	BeaconHeader   *BeaconHeader  `protobuf:"bytes,2,opt,name=beacon_header,json=beaconHeader,proto3" json:"beacon_header,omitempty"`
	EpochHeaders   []BeaconHeader `protobuf:"bytes,3,rep,name=epoch_headers,json=epochHeaders,proto3" json:"epoch_headers"`
	CrossLinkIndex uint32         `protobuf:"varint,4,opt,name=cross_link_index,json=crossLinkIndex,proto3" json:"cross_link_index,omitempty"`
	AccountProof   []byte         `protobuf:"bytes,5,opt,name=account_proof,json=accountProof,proto3" json:"account_proof,omitempty"`
}

func (Header) ClientType

func (h Header) ClientType() string

func (*Header) Descriptor

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

func (Header) GetAccountProof

func (h Header) GetAccountProof() ([][]byte, error)

func (Header) GetBeaconEpoch

func (h Header) GetBeaconEpoch() *big.Int

GetEpoch returns the last beacon epoch

func (Header) GetEpoch

func (h Header) GetEpoch() *big.Int

GetEpoch returns the target epoch

func (Header) GetHeight

func (h Header) GetHeight() exported.Height

GetHeight returns the target height

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

func (h Header) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method

func (Header) ValidateBasic

func (h 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 MemDB

type MemDB struct {
	// contains filtered or unexported fields
}

MemDB is an ethdb.KeyValueReader implementation which is not thread safe and assumes that all keys are common.Hash.

func NewMemDB

func NewMemDB() *MemDB

NewMemDB creates a new empty MemDB

func (*MemDB) Get

func (m *MemDB) Get(key []byte) ([]byte, error)

Get returns the value of the key, or nil if it's not found

func (*MemDB) Has

func (m *MemDB) Has(key []byte) (bool, error)

Has returns true if the MemBD contains the key

func (*MemDB) Put

func (m *MemDB) Put(key []byte, value []byte)

Put sets or updates the value at key

type Misbehaviour

type Misbehaviour struct {
	ClientId string  `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	Header1  *Header `protobuf:"bytes,2,opt,name=header_1,json=header1,proto3" json:"header_1,omitempty"`
	Header2  *Header `protobuf:"bytes,3,opt,name=header_2,json=header2,proto3" json:"header_2,omitempty"`
}

func (Misbehaviour) ClientType

func (misbehaviour Misbehaviour) ClientType() string

ClientType is a Multisig light client.

func (*Misbehaviour) Descriptor

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

func (Misbehaviour) GetClientID

func (misbehaviour Misbehaviour) GetClientID() string

GetClientID returns the ID of the client that committed a misbehaviour.

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

func (misbehaviour Misbehaviour) Type() string

Type implements Evidence interface.

func (*Misbehaviour) Unmarshal

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

func (Misbehaviour) ValidateBasic

func (misbehaviour Misbehaviour) ValidateBasic() error

ValidateBasic implements Evidence 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

Jump to

Keyboard shortcuts

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