cosmos-sdk: github.com/cosmos/cosmos-sdk/crypto/types Index | Files | Directories

package types

import "github.com/cosmos/cosmos-sdk/crypto/types"

Index

Package Files

compact_bit_array.go multisig.pb.go types.go

Variables

var (
    ErrInvalidLengthMultisig        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowMultisig          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupMultisig = fmt.Errorf("proto: unexpected end of group")
)

type Address Uses

type Address = tmcrypto.Address

type CompactBitArray Uses

type CompactBitArray struct {
    ExtraBitsStored uint32 `protobuf:"varint,1,opt,name=extra_bits_stored,json=extraBitsStored,proto3" json:"extra_bits_stored,omitempty"`
    Elems           []byte `protobuf:"bytes,2,opt,name=elems,proto3" json:"elems,omitempty"`
}

CompactBitArray is an implementation of a space efficient bit array. This is used to ensure that the encoded data takes up a minimal amount of space after proto encoding. This is not thread safe, and is not intended for concurrent usage.

func CompactUnmarshal Uses

func CompactUnmarshal(bz []byte) (*CompactBitArray, error)

CompactUnmarshal is a space efficient decoding for CompactBitArray. It is not amino compatible.

func NewCompactBitArray Uses

func NewCompactBitArray(bits int) *CompactBitArray

NewCompactBitArray returns a new compact bit array. It returns nil if the number of bits is zero.

func (*CompactBitArray) CompactMarshal Uses

func (bA *CompactBitArray) CompactMarshal() []byte

CompactMarshal is a space efficient encoding for CompactBitArray. It is not amino compatible.

func (*CompactBitArray) Copy Uses

func (bA *CompactBitArray) Copy() *CompactBitArray

Copy returns a copy of the provided bit array.

func (*CompactBitArray) Count Uses

func (bA *CompactBitArray) Count() int

Count returns the number of bits in the bitarray

func (*CompactBitArray) Descriptor Uses

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

func (*CompactBitArray) GetElems Uses

func (m *CompactBitArray) GetElems() []byte

func (*CompactBitArray) GetExtraBitsStored Uses

func (m *CompactBitArray) GetExtraBitsStored() uint32

func (*CompactBitArray) GetIndex Uses

func (bA *CompactBitArray) GetIndex(i int) bool

GetIndex returns the bit at index i within the bit array. The behavior is undefined if i >= bA.Count()

func (*CompactBitArray) Marshal Uses

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

func (*CompactBitArray) MarshalJSON Uses

func (bA *CompactBitArray) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface by marshaling bit array using a custom format: a string of '-' or 'x' where 'x' denotes the 1 bit.

func (*CompactBitArray) MarshalTo Uses

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

func (*CompactBitArray) MarshalToSizedBuffer Uses

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

func (*CompactBitArray) NumTrueBitsBefore Uses

func (bA *CompactBitArray) NumTrueBitsBefore(index int) int

NumTrueBitsBefore returns the number of bits set to true before the given index. e.g. if bA = _XX__XX, NumOfTrueBitsBefore(4) = 2, since there are two bits set to true before index 4.

func (*CompactBitArray) ProtoMessage Uses

func (*CompactBitArray) ProtoMessage()

func (*CompactBitArray) Reset Uses

func (m *CompactBitArray) Reset()

func (*CompactBitArray) SetIndex Uses

func (bA *CompactBitArray) SetIndex(i int, v bool) bool

SetIndex sets the bit at index i within the bit array. The behavior is undefined if i >= bA.Count()

func (*CompactBitArray) Size Uses

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

func (*CompactBitArray) String Uses

func (bA *CompactBitArray) String() string

String returns a string representation of CompactBitArray: BA{<bit-string>}, where <bit-string> is a sequence of 'x' (1) and '_' (0). The <bit-string> includes spaces and newlines to help people. For a simple sequence of 'x' and '_' characters with no spaces or newlines, see the MarshalJSON() method. Example: "BA{_x_}" or "nil-BitArray" for nil.

func (*CompactBitArray) StringIndented Uses

func (bA *CompactBitArray) StringIndented(indent string) string

StringIndented returns the same thing as String(), but applies the indent at every 10th bit, and twice at every 50th bit.

func (*CompactBitArray) Unmarshal Uses

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

func (*CompactBitArray) UnmarshalJSON Uses

func (bA *CompactBitArray) UnmarshalJSON(bz []byte) error

UnmarshalJSON implements json.Unmarshaler interface by unmarshaling a custom JSON description.

func (*CompactBitArray) XXX_DiscardUnknown Uses

func (m *CompactBitArray) XXX_DiscardUnknown()

func (*CompactBitArray) XXX_Marshal Uses

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

func (*CompactBitArray) XXX_Merge Uses

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

func (*CompactBitArray) XXX_Size Uses

func (m *CompactBitArray) XXX_Size() int

func (*CompactBitArray) XXX_Unmarshal Uses

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

type LedgerPrivKey Uses

type LedgerPrivKey interface {
    Bytes() []byte
    Sign(msg []byte) ([]byte, error)
    PubKey() PubKey
    Equals(LedgerPrivKey) bool
    Type() string
}

LedgerPrivKey defines a private key that is not a proto message. For now, LedgerSecp256k1 keys are not converted to proto.Message yet, this is why they use LedgerPrivKey instead of PrivKey. All other keys must use PrivKey instead of LedgerPrivKey. TODO https://github.com/cosmos/cosmos-sdk/issues/7357.

type MultiSignature Uses

type MultiSignature struct {
    Signatures       [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"`
    XXX_unrecognized []byte   `json:"-"`
}

MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers signed and with which modes.

func (*MultiSignature) Descriptor Uses

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

func (*MultiSignature) GetSignatures Uses

func (m *MultiSignature) GetSignatures() [][]byte

func (*MultiSignature) Marshal Uses

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

func (*MultiSignature) MarshalTo Uses

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

func (*MultiSignature) MarshalToSizedBuffer Uses

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

func (*MultiSignature) ProtoMessage Uses

func (*MultiSignature) ProtoMessage()

func (*MultiSignature) Reset Uses

func (m *MultiSignature) Reset()

func (*MultiSignature) Size Uses

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

func (*MultiSignature) String Uses

func (m *MultiSignature) String() string

func (*MultiSignature) Unmarshal Uses

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

func (*MultiSignature) XXX_DiscardUnknown Uses

func (m *MultiSignature) XXX_DiscardUnknown()

func (*MultiSignature) XXX_Marshal Uses

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

func (*MultiSignature) XXX_Merge Uses

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

func (*MultiSignature) XXX_Size Uses

func (m *MultiSignature) XXX_Size() int

func (*MultiSignature) XXX_Unmarshal Uses

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

type PrivKey Uses

type PrivKey interface {
    proto.Message
    LedgerPrivKey
}

PrivKey defines a private key and extends proto.Message. For now, it extends LedgerPrivKey (see godoc for LedgerPrivKey). Ultimately, we should remove LedgerPrivKey and add its methods here directly. TODO https://github.com/cosmos/cosmos-sdk/issues/7357.

type PubKey Uses

type PubKey interface {
    proto.Message

    Address() Address
    Bytes() []byte
    VerifySignature(msg []byte, sig []byte) bool
    Equals(PubKey) bool
    Type() string
}

PubKey defines a public key and extends proto.Message.

Directories

PathSynopsis
multisig

Package types imports 12 packages (graph) and is imported by 56 packages. Updated 2021-01-16. Refresh now. Tools for package owners.