types

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type CompactBitArray

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

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

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

func NewCompactBitArray

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

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

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

func (*CompactBitArray) Copy

func (bA *CompactBitArray) Copy() *CompactBitArray

Copy returns a copy of the provided bit array.

func (*CompactBitArray) Count

func (bA *CompactBitArray) Count() int

Count returns the number of bits in the bitarray

func (*CompactBitArray) Descriptor

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

func (*CompactBitArray) GetElems

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

func (*CompactBitArray) GetExtraBitsStored

func (m *CompactBitArray) GetExtraBitsStored() uint32

func (*CompactBitArray) GetIndex

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

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

func (*CompactBitArray) MarshalJSON

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

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

func (*CompactBitArray) MarshalToSizedBuffer

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

func (*CompactBitArray) NumTrueBitsBefore

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

func (*CompactBitArray) ProtoMessage()

func (*CompactBitArray) Reset

func (m *CompactBitArray) Reset()

func (*CompactBitArray) SetIndex

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

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

func (*CompactBitArray) String

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

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

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

func (*CompactBitArray) UnmarshalJSON

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

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

func (*CompactBitArray) XXX_DiscardUnknown

func (m *CompactBitArray) XXX_DiscardUnknown()

func (*CompactBitArray) XXX_Marshal

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

func (*CompactBitArray) XXX_Merge

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

func (*CompactBitArray) XXX_Size

func (m *CompactBitArray) XXX_Size() int

func (*CompactBitArray) XXX_Unmarshal

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

type MultiSignature

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

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

func (*MultiSignature) GetSignatures

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

func (*MultiSignature) Marshal

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

func (*MultiSignature) MarshalTo

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

func (*MultiSignature) MarshalToSizedBuffer

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

func (*MultiSignature) ProtoMessage

func (*MultiSignature) ProtoMessage()

func (*MultiSignature) Reset

func (m *MultiSignature) Reset()

func (*MultiSignature) Size

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

func (*MultiSignature) String

func (m *MultiSignature) String() string

func (*MultiSignature) Unmarshal

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

func (*MultiSignature) XXX_DiscardUnknown

func (m *MultiSignature) XXX_DiscardUnknown()

func (*MultiSignature) XXX_Marshal

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

func (*MultiSignature) XXX_Merge

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

func (*MultiSignature) XXX_Size

func (m *MultiSignature) XXX_Size() int

func (*MultiSignature) XXX_Unmarshal

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

type PubKeyMultisigThreshold

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

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

func (*PubKeyMultisigThreshold) GetK

func (m *PubKeyMultisigThreshold) GetK() uint32

func (*PubKeyMultisigThreshold) GetPubKeys

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

func (*PubKeyMultisigThreshold) Marshal

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

func (*PubKeyMultisigThreshold) MarshalTo

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

func (*PubKeyMultisigThreshold) MarshalToSizedBuffer

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

func (*PubKeyMultisigThreshold) ProtoMessage

func (*PubKeyMultisigThreshold) ProtoMessage()

func (*PubKeyMultisigThreshold) Reset

func (m *PubKeyMultisigThreshold) Reset()

func (*PubKeyMultisigThreshold) Size

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

func (*PubKeyMultisigThreshold) String

func (m *PubKeyMultisigThreshold) String() string

func (*PubKeyMultisigThreshold) Unmarshal

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

func (*PubKeyMultisigThreshold) XXX_DiscardUnknown

func (m *PubKeyMultisigThreshold) XXX_DiscardUnknown()

func (*PubKeyMultisigThreshold) XXX_Marshal

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

func (*PubKeyMultisigThreshold) XXX_Merge

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

func (*PubKeyMultisigThreshold) XXX_Size

func (m *PubKeyMultisigThreshold) XXX_Size() int

func (*PubKeyMultisigThreshold) XXX_Unmarshal

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

type PublicKey

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_Sm2
	//	*PublicKey_AnyPubkey
	Sum isPublicKey_Sum `protobuf_oneof:"sum"`
}

PublicKey specifies a public key

func (*PublicKey) Descriptor

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

func (*PublicKey) GetAnyPubkey

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

func (*PublicKey) GetEd25519

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

func (*PublicKey) GetMultisig

func (m *PublicKey) GetMultisig() *PubKeyMultisigThreshold

func (*PublicKey) GetSecp256K1

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

func (*PublicKey) GetSecp256R1

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

func (*PublicKey) GetSm2

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

func (*PublicKey) GetSr25519

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

func (*PublicKey) GetSum

func (m *PublicKey) GetSum() isPublicKey_Sum

func (*PublicKey) Marshal

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

func (*PublicKey) MarshalTo

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

func (*PublicKey) MarshalToSizedBuffer

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

func (*PublicKey) ProtoMessage

func (*PublicKey) ProtoMessage()

func (*PublicKey) Reset

func (m *PublicKey) Reset()

func (*PublicKey) Size

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

func (*PublicKey) String

func (m *PublicKey) String() string

func (*PublicKey) Unmarshal

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

func (*PublicKey) XXX_DiscardUnknown

func (m *PublicKey) XXX_DiscardUnknown()

func (*PublicKey) XXX_Marshal

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

func (*PublicKey) XXX_Merge

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

func (*PublicKey) XXX_OneofWrappers

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

XXX_OneofWrappers is for the internal use of the proto package.

func (*PublicKey) XXX_Size

func (m *PublicKey) XXX_Size() int

func (*PublicKey) XXX_Unmarshal

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

type PublicKeyCodec

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

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

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

func (*PublicKey_AnyPubkey) MarshalToSizedBuffer

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

func (*PublicKey_AnyPubkey) Size

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

type PublicKey_Ed25519

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

func (*PublicKey_Ed25519) MarshalTo

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

func (*PublicKey_Ed25519) MarshalToSizedBuffer

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

func (*PublicKey_Ed25519) Size

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

type PublicKey_Multisig

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

func (*PublicKey_Multisig) MarshalTo

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

func (*PublicKey_Multisig) MarshalToSizedBuffer

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

func (*PublicKey_Multisig) Size

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

type PublicKey_Secp256K1

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

func (*PublicKey_Secp256K1) MarshalTo

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

func (*PublicKey_Secp256K1) MarshalToSizedBuffer

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

func (*PublicKey_Secp256K1) Size

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

type PublicKey_Secp256R1

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

func (*PublicKey_Secp256R1) MarshalTo

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

func (*PublicKey_Secp256R1) MarshalToSizedBuffer

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

func (*PublicKey_Secp256R1) Size

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

type PublicKey_Sm2

type PublicKey_Sm2 struct {
	Sm2 []byte `protobuf:"bytes,6,opt,name=sm2,proto3,oneof" json:"sm2,omitempty"`
}

func (*PublicKey_Sm2) MarshalTo

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

func (*PublicKey_Sm2) MarshalToSizedBuffer

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

func (*PublicKey_Sm2) Size

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

type PublicKey_Sr25519

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

func (*PublicKey_Sr25519) MarshalTo

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

func (*PublicKey_Sr25519) MarshalToSizedBuffer

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

func (*PublicKey_Sr25519) Size

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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