multisig

package
Version: v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 16 Imported by: 68

Documentation

Index

Constants

View Source
const (
	PubKeyAminoRoute = "tendermint/PubKeyMultisigThreshold"
)

TODO: Figure out API for others to either add their own pubkey types, or to make verify / marshal accept a AminoCdc.

Variables

View Source
var (
	ErrInvalidLengthKeys        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowKeys          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group")
)
View Source
var AminoCdc = codec.NewLegacyAmino()

nolint Deprecated: Amino is being deprecated in the SDK. But even if you need to use Amino for some reason, please use `codec/legacy.Cdc` instead.

Functions

This section is empty.

Types

type LegacyAminoPubKey

type LegacyAminoPubKey struct {
	Threshold uint32       `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty" yaml:"threshold"`
	PubKeys   []*types.Any `protobuf:"bytes,2,rep,name=public_keys,json=publicKeys,proto3" json:"public_keys,omitempty" yaml:"pubkeys"`
}

LegacyAminoPubKey specifies a public key type which nests multiple public keys and a threshold, it uses legacy amino address rules.

func NewLegacyAminoPubKey

func NewLegacyAminoPubKey(threshold int, pubKeys []cryptotypes.PubKey) *LegacyAminoPubKey

NewLegacyAminoPubKey returns a new LegacyAminoPubKey. Multisig can be constructed with multiple same keys - it will increase the power of the owner of that key (he will still need to add multiple signatures in the right order). Panics if len(pubKeys) < k or 0 >= k.

func (*LegacyAminoPubKey) Address

func (m *LegacyAminoPubKey) Address() cryptotypes.Address

Address implements cryptotypes.PubKey Address method

func (*LegacyAminoPubKey) Bytes

func (m *LegacyAminoPubKey) Bytes() []byte

Bytes returns the proto encoded version of the LegacyAminoPubKey

func (*LegacyAminoPubKey) Descriptor

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

func (*LegacyAminoPubKey) Equals

func (m *LegacyAminoPubKey) Equals(key cryptotypes.PubKey) bool

Equals returns true if m and other both have the same number of keys, and all constituent keys are the same, and in the same order.

func (*LegacyAminoPubKey) GetPubKeys

func (m *LegacyAminoPubKey) GetPubKeys() []cryptotypes.PubKey

GetPubKeys implements the PubKey.GetPubKeys method

func (*LegacyAminoPubKey) GetThreshold

func (m *LegacyAminoPubKey) GetThreshold() uint

GetThreshold implements the PubKey.GetThreshold method

func (*LegacyAminoPubKey) Marshal

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

func (LegacyAminoPubKey) MarshalAminoJSON added in v0.42.2

func (m LegacyAminoPubKey) MarshalAminoJSON() (tmMultisig, error)

MarshalAminoJSON overrides amino JSON unmarshaling.

func (*LegacyAminoPubKey) MarshalTo

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

func (*LegacyAminoPubKey) MarshalToSizedBuffer

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

func (*LegacyAminoPubKey) ProtoMessage

func (*LegacyAminoPubKey) ProtoMessage()

func (*LegacyAminoPubKey) Reset

func (m *LegacyAminoPubKey) Reset()

func (*LegacyAminoPubKey) Size

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

func (*LegacyAminoPubKey) String

func (m *LegacyAminoPubKey) String() string

func (*LegacyAminoPubKey) Type

func (m *LegacyAminoPubKey) Type() string

Type returns multisig type

func (*LegacyAminoPubKey) Unmarshal

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

func (*LegacyAminoPubKey) UnmarshalAminoJSON added in v0.42.2

func (m *LegacyAminoPubKey) UnmarshalAminoJSON(tmPk tmMultisig) error

UnmarshalAminoJSON overrides amino JSON unmarshaling.

func (*LegacyAminoPubKey) UnpackInterfaces

func (m *LegacyAminoPubKey) UnpackInterfaces(unpacker types.AnyUnpacker) error

UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces

func (*LegacyAminoPubKey) VerifyMultisignature

func (m *LegacyAminoPubKey) VerifyMultisignature(getSignBytes multisigtypes.GetSignBytesFunc, sig *signing.MultiSignatureData) error

VerifyMultisignature implements the multisigtypes.PubKey VerifyMultisignature method. The signatures must be added in an order corresponding to the public keys order in LegacyAminoPubKey. It's OK to have multiple same keys in the multisig - it will increase the power of the owner of that key - in that case the signer will still need to append multiple same signatures in the right order.

func (*LegacyAminoPubKey) VerifySignature

func (m *LegacyAminoPubKey) VerifySignature(msg []byte, sig []byte) bool

VerifySignature implements cryptotypes.PubKey VerifySignature method, it panics because it can't handle MultiSignatureData cf. https://github.com/cosmos/cosmos-sdk/issues/7109#issuecomment-686329936

func (*LegacyAminoPubKey) XXX_DiscardUnknown

func (m *LegacyAminoPubKey) XXX_DiscardUnknown()

func (*LegacyAminoPubKey) XXX_Marshal

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

func (*LegacyAminoPubKey) XXX_Merge

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

func (*LegacyAminoPubKey) XXX_Size

func (m *LegacyAminoPubKey) XXX_Size() int

func (*LegacyAminoPubKey) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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