multisig

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSignature

func AddSignature(mSig *signing.MultiSignatureData, sig signing.SignatureData, index int)

AddSignature adds a signature to the multisig, at the corresponding index. If the signature already exists, replace it.

func AddSignatureFromPubKey

func AddSignatureFromPubKey(mSig *signing.MultiSignatureData, sig signing.SignatureData, pubkey types.PubKey, keys []types.PubKey) error

AddSignatureFromPubKey adds a signature to the multisig, at the index in keys corresponding to the provided pubkey.

func AddSignatureV2

func AddSignatureV2(mSig *signing.MultiSignatureData, sig signing.SignatureV2, keys []types.PubKey) error

func NewMultisig

func NewMultisig(n int) *signing.MultiSignatureData

NewMultisig returns a new MultiSignatureData

Types

type AminoMultisignature

type AminoMultisignature struct {
	BitArray *types.CompactBitArray
	Sigs     [][]byte
}

AminoMultisignature is used to represent amino multi-signatures for StdTx's. It is assumed that all signatures were made with SIGN_MODE_LEGACY_AMINO_JSON. Sigs is a list of signatures, sorted by corresponding index.

type GetSignBytesFunc

type GetSignBytesFunc func(mode signing.SignMode) ([]byte, error)

GetSignBytesFunc defines a function type which returns sign bytes for a given SignMode or an error. It will generally be implemented as a closure which wraps whatever signable object signatures are being verified against.

type PubKey

type PubKey interface {
	types.PubKey

	// VerifyMultisignature verifies the provide multi-signature represented by MultiSignatureData
	// using getSignBytes to retrieve the sign bytes to verify against for the provided mode.
	VerifyMultisignature(getSignBytes GetSignBytesFunc, sig *signing.MultiSignatureData) error

	// GetPubKeys returns the types.PubKey's nested within the multi-sig PubKey
	GetPubKeys() []types.PubKey

	// GetThreshold returns the threshold number of signatures that must be obtained to verify a signature.
	GetThreshold() uint
}

PubKey defines a type which supports multi-signature verification via MultiSignatureData which supports multiple SignMode's.

Jump to

Keyboard shortcuts

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