commitment

package
v0.0.0-...-a76333c Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const SubModuleName string = "commitment"

SubModuleName is the error codespace

Variables

View Source
var (
	ErrInvalidLengthCommitment        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCommitment          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupCommitment = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidProof       = types.Register(moduleName, 2, "invalid proof")
	ErrInvalidPrefix      = types.Register(moduleName, 3, "invalid prefix")
	ErrInvalidMerkleProof = types.Register(moduleName, 4, "invalid merkle proof")
)

IBC connection sentinel errors

Functions

func GetSDKSpecs

func GetSDKSpecs() []*ics23.ProofSpec

GetSDKSpecs is a getter function for the proofspecs of an sdk chain

Types

type MerklePath

type MerklePath struct {
	KeyPath []string `protobuf:"bytes,1,rep,name=key_path,json=keyPath,proto3" json:"key_path,omitempty" yaml:"key_path"`
}

MerklePath is the path used to verify commitment proofs, which can be an arbitrary structured object (defined by a commitment type). MerklePath is represented from root-to-leaf

func (*MerklePath) Descriptor

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

func (*MerklePath) GetKeyPath

func (m *MerklePath) GetKeyPath() []string

func (*MerklePath) Marshal

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

func (*MerklePath) MarshalTo

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

func (*MerklePath) MarshalToSizedBuffer

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

func (*MerklePath) ProtoMessage

func (*MerklePath) ProtoMessage()

func (*MerklePath) Reset

func (m *MerklePath) Reset()

func (*MerklePath) Size

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

func (MerklePath) String

func (mp MerklePath) String() string

func (*MerklePath) Unmarshal

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

func (*MerklePath) XXX_DiscardUnknown

func (m *MerklePath) XXX_DiscardUnknown()

func (*MerklePath) XXX_Marshal

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

func (*MerklePath) XXX_Merge

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

func (*MerklePath) XXX_Size

func (m *MerklePath) XXX_Size() int

func (*MerklePath) XXX_Unmarshal

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

type MerklePrefix

type MerklePrefix struct {
	KeyPrefix []byte `protobuf:"bytes,1,opt,name=key_prefix,json=keyPrefix,proto3" json:"key_prefix,omitempty" yaml:"key_prefix"`
}

MerklePrefix is merkle path prefixed to the key. The constructed key from the Path and the key will be append(Path.KeyPath, append(Path.KeyPrefix, key...))

func NewMerklePrefix

func NewMerklePrefix(keyPrefix []byte) MerklePrefix

NewMerklePrefix constructs new MerklePrefix instance

func (MerklePrefix) Bytes

func (mp MerklePrefix) Bytes() []byte

Bytes returns the key prefix bytes

func (*MerklePrefix) Descriptor

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

func (MerklePrefix) Empty

func (mp MerklePrefix) Empty() bool

Empty returns true if the prefix is empty

func (*MerklePrefix) GetKeyPrefix

func (m *MerklePrefix) GetKeyPrefix() []byte

func (*MerklePrefix) Marshal

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

func (*MerklePrefix) MarshalTo

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

func (*MerklePrefix) MarshalToSizedBuffer

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

func (*MerklePrefix) ProtoMessage

func (*MerklePrefix) ProtoMessage()

func (*MerklePrefix) Reset

func (m *MerklePrefix) Reset()

func (*MerklePrefix) Size

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

func (*MerklePrefix) String

func (m *MerklePrefix) String() string

func (*MerklePrefix) Unmarshal

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

func (*MerklePrefix) XXX_DiscardUnknown

func (m *MerklePrefix) XXX_DiscardUnknown()

func (*MerklePrefix) XXX_Marshal

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

func (*MerklePrefix) XXX_Merge

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

func (*MerklePrefix) XXX_Size

func (m *MerklePrefix) XXX_Size() int

func (*MerklePrefix) XXX_Unmarshal

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

type MerkleProof

type MerkleProof struct {
	Proofs []*_go.CommitmentProof `protobuf:"bytes,1,rep,name=proofs,proto3" json:"proofs,omitempty"`
}

MerkleProof is a wrapper type over a chain of CommitmentProofs. It demonstrates membership or non-membership for an element or set of elements, verifiable in conjunction with a known commitment root. Proofs should be succinct. MerkleProofs are ordered from leaf-to-root

func ConvertProofs

func ConvertProofs(tmProof *crypto.ProofOps) (MerkleProof, error)

ConvertProofs converts crypto.ProofOps into MerkleProof

func (*MerkleProof) Descriptor

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

func (*MerkleProof) GetProofs

func (m *MerkleProof) GetProofs() []*_go.CommitmentProof

func (*MerkleProof) Marshal

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

func (*MerkleProof) MarshalTo

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

func (*MerkleProof) MarshalToSizedBuffer

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

func (*MerkleProof) ProtoMessage

func (*MerkleProof) ProtoMessage()

func (*MerkleProof) Reset

func (m *MerkleProof) Reset()

func (*MerkleProof) Size

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

func (*MerkleProof) String

func (m *MerkleProof) String() string

func (*MerkleProof) Unmarshal

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

func (*MerkleProof) XXX_DiscardUnknown

func (m *MerkleProof) XXX_DiscardUnknown()

func (*MerkleProof) XXX_Marshal

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

func (*MerkleProof) XXX_Merge

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

func (*MerkleProof) XXX_Size

func (m *MerkleProof) XXX_Size() int

func (*MerkleProof) XXX_Unmarshal

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

type MerkleRoot

type MerkleRoot struct {
	Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
}

MerkleRoot defines a merkle root hash. In the Cosmos SDK, the AppHash of a block header becomes the root.

func NewMerkleRoot

func NewMerkleRoot(hash []byte) MerkleRoot

NewMerkleRoot constructs a new MerkleRoot

func (*MerkleRoot) Descriptor

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

func (MerkleRoot) Empty

func (mr MerkleRoot) Empty() bool

Empty returns true if the root is empty

func (MerkleRoot) GetHash

func (mr MerkleRoot) GetHash() []byte

GetHash implements RootI interface

func (*MerkleRoot) Marshal

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

func (*MerkleRoot) MarshalTo

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

func (*MerkleRoot) MarshalToSizedBuffer

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

func (*MerkleRoot) ProtoMessage

func (*MerkleRoot) ProtoMessage()

func (*MerkleRoot) Reset

func (m *MerkleRoot) Reset()

func (*MerkleRoot) Size

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

func (*MerkleRoot) String

func (m *MerkleRoot) String() string

func (*MerkleRoot) Unmarshal

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

func (*MerkleRoot) XXX_DiscardUnknown

func (m *MerkleRoot) XXX_DiscardUnknown()

func (*MerkleRoot) XXX_Marshal

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

func (*MerkleRoot) XXX_Merge

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

func (*MerkleRoot) XXX_Size

func (m *MerkleRoot) XXX_Size() int

func (*MerkleRoot) XXX_Unmarshal

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

type Prefix

type Prefix interface {
	Bytes() []byte
	Empty() bool
}

Prefix implements spec:CommitmentPrefix. Prefix represents the common "prefix" that a set of keys shares.

Jump to

Keyboard shortcuts

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