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

codec.go compact_bit_array.go crypto.pb.go

Variables

var (
    ErrInvalidLengthCrypto        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowCrypto          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupCrypto = fmt.Errorf("proto: unexpected end of group")
)

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 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 PubKeyMultisigThreshold. 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 PubKeyMultisigThreshold Uses

type PubKeyMultisigThreshold struct {
    K       uint32       `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty" yaml:"threshold"`
    PubKeys []*PublicKey `protobuf:"bytes,2,rep,name=public_keys,json=publicKeys,proto3" json:"public_keys,omitempty" yaml:"pubkeys"`
}

PubKeyMultisigThreshold specifies a public key type which nests multiple public keys and a threshold

func (*PubKeyMultisigThreshold) Descriptor Uses

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

func (*PubKeyMultisigThreshold) GetK Uses

func (m *PubKeyMultisigThreshold) GetK() uint32

func (*PubKeyMultisigThreshold) GetPubKeys Uses

func (m *PubKeyMultisigThreshold) GetPubKeys() []*PublicKey

func (*PubKeyMultisigThreshold) Marshal Uses

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

func (*PubKeyMultisigThreshold) MarshalTo Uses

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

func (*PubKeyMultisigThreshold) MarshalToSizedBuffer Uses

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

func (*PubKeyMultisigThreshold) ProtoMessage Uses

func (*PubKeyMultisigThreshold) ProtoMessage()

func (*PubKeyMultisigThreshold) Reset Uses

func (m *PubKeyMultisigThreshold) Reset()

func (*PubKeyMultisigThreshold) Size Uses

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

func (*PubKeyMultisigThreshold) String Uses

func (m *PubKeyMultisigThreshold) String() string

func (*PubKeyMultisigThreshold) Unmarshal Uses

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

func (*PubKeyMultisigThreshold) XXX_DiscardUnknown Uses

func (m *PubKeyMultisigThreshold) XXX_DiscardUnknown()

func (*PubKeyMultisigThreshold) XXX_Marshal Uses

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

func (*PubKeyMultisigThreshold) XXX_Merge Uses

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

func (*PubKeyMultisigThreshold) XXX_Size Uses

func (m *PubKeyMultisigThreshold) XXX_Size() int

func (*PubKeyMultisigThreshold) XXX_Unmarshal Uses

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

type PublicKey Uses

type PublicKey struct {
    // sum specifies which type of public key is wrapped
    //
    // Types that are valid to be assigned to Sum:
    //	*PublicKey_Secp256K1
    //	*PublicKey_Ed25519
    //	*PublicKey_Sr25519
    //	*PublicKey_Multisig
    //	*PublicKey_Secp256R1
    //	*PublicKey_AnyPubkey
    Sum isPublicKey_Sum `protobuf_oneof:"sum"`
}

PublicKey specifies a public key

func (*PublicKey) Descriptor Uses

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

func (*PublicKey) GetAnyPubkey Uses

func (m *PublicKey) GetAnyPubkey() *types.Any

func (*PublicKey) GetEd25519 Uses

func (m *PublicKey) GetEd25519() []byte

func (*PublicKey) GetMultisig Uses

func (m *PublicKey) GetMultisig() *PubKeyMultisigThreshold

func (*PublicKey) GetSecp256K1 Uses

func (m *PublicKey) GetSecp256K1() []byte

func (*PublicKey) GetSecp256R1 Uses

func (m *PublicKey) GetSecp256R1() []byte

func (*PublicKey) GetSr25519 Uses

func (m *PublicKey) GetSr25519() []byte

func (*PublicKey) GetSum Uses

func (m *PublicKey) GetSum() isPublicKey_Sum

func (*PublicKey) Marshal Uses

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

func (*PublicKey) MarshalTo Uses

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

func (*PublicKey) MarshalToSizedBuffer Uses

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

func (*PublicKey) ProtoMessage Uses

func (*PublicKey) ProtoMessage()

func (*PublicKey) Reset Uses

func (m *PublicKey) Reset()

func (*PublicKey) Size Uses

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

func (*PublicKey) String Uses

func (m *PublicKey) String() string

func (*PublicKey) Unmarshal Uses

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

func (*PublicKey) XXX_DiscardUnknown Uses

func (m *PublicKey) XXX_DiscardUnknown()

func (*PublicKey) XXX_Marshal Uses

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

func (*PublicKey) XXX_Merge Uses

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

func (*PublicKey) XXX_OneofWrappers Uses

func (*PublicKey) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*PublicKey) XXX_Size Uses

func (m *PublicKey) XXX_Size() int

func (*PublicKey) XXX_Unmarshal Uses

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

type PublicKeyCodec Uses

type PublicKeyCodec interface {
    // Encode encodes the crypto.PubKey as a protobuf PublicKey or returns an error
    Encode(key crypto.PubKey) (*PublicKey, error)

    // Decode decodes a crypto.PubKey from a protobuf PublicKey or returns an error
    Decode(key *PublicKey) (crypto.PubKey, error)
}

PublicKeyCodec defines a type which can encode and decode crypto.PubKey's to and from protobuf PublicKey's

type PublicKey_AnyPubkey Uses

type PublicKey_AnyPubkey struct {
    AnyPubkey *types.Any `protobuf:"bytes,15,opt,name=any_pubkey,json=anyPubkey,proto3,oneof" json:"any_pubkey,omitempty"`
}

func (*PublicKey_AnyPubkey) MarshalTo Uses

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

func (*PublicKey_AnyPubkey) MarshalToSizedBuffer Uses

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

func (*PublicKey_AnyPubkey) Size Uses

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

type PublicKey_Ed25519 Uses

type PublicKey_Ed25519 struct {
    Ed25519 []byte `protobuf:"bytes,2,opt,name=ed25519,proto3,oneof" json:"ed25519,omitempty"`
}

func (*PublicKey_Ed25519) MarshalTo Uses

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

func (*PublicKey_Ed25519) MarshalToSizedBuffer Uses

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

func (*PublicKey_Ed25519) Size Uses

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

type PublicKey_Multisig Uses

type PublicKey_Multisig struct {
    Multisig *PubKeyMultisigThreshold `protobuf:"bytes,4,opt,name=multisig,proto3,oneof" json:"multisig,omitempty"`
}

func (*PublicKey_Multisig) MarshalTo Uses

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

func (*PublicKey_Multisig) MarshalToSizedBuffer Uses

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

func (*PublicKey_Multisig) Size Uses

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

type PublicKey_Secp256K1 Uses

type PublicKey_Secp256K1 struct {
    Secp256K1 []byte `protobuf:"bytes,1,opt,name=secp256k1,proto3,oneof" json:"secp256k1,omitempty"`
}

func (*PublicKey_Secp256K1) MarshalTo Uses

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

func (*PublicKey_Secp256K1) MarshalToSizedBuffer Uses

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

func (*PublicKey_Secp256K1) Size Uses

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

type PublicKey_Secp256R1 Uses

type PublicKey_Secp256R1 struct {
    Secp256R1 []byte `protobuf:"bytes,5,opt,name=secp256r1,proto3,oneof" json:"secp256r1,omitempty"`
}

func (*PublicKey_Secp256R1) MarshalTo Uses

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

func (*PublicKey_Secp256R1) MarshalToSizedBuffer Uses

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

func (*PublicKey_Secp256R1) Size Uses

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

type PublicKey_Sr25519 Uses

type PublicKey_Sr25519 struct {
    Sr25519 []byte `protobuf:"bytes,3,opt,name=sr25519,proto3,oneof" json:"sr25519,omitempty"`
}

func (*PublicKey_Sr25519) MarshalTo Uses

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

func (*PublicKey_Sr25519) MarshalToSizedBuffer Uses

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

func (*PublicKey_Sr25519) Size Uses

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

Directories

PathSynopsis
multisig

Package types imports 13 packages (graph) and is imported by 5 packages. Updated 2020-08-13. Refresh now. Tools for package owners.