github.com/cosmos/cosmos-sdk@v0.50.1/crypto/types/multisig/pubkey.go (about)

     1  package multisig
     2  
     3  import (
     4  	"github.com/cosmos/cosmos-sdk/crypto/types"
     5  	"github.com/cosmos/cosmos-sdk/types/tx/signing"
     6  )
     7  
     8  // PubKey defines a type which supports multi-signature verification via MultiSignatureData
     9  // which supports multiple SignMode's.
    10  type PubKey interface {
    11  	types.PubKey
    12  
    13  	// VerifyMultisignature verifies the provide multi-signature represented by MultiSignatureData
    14  	// using getSignBytes to retrieve the sign bytes to verify against for the provided mode.
    15  	VerifyMultisignature(getSignBytes GetSignBytesFunc, sig *signing.MultiSignatureData) error
    16  
    17  	// GetPubKeys returns the types.PubKey's nested within the multi-sig PubKey
    18  	GetPubKeys() []types.PubKey
    19  
    20  	// GetThreshold returns the threshold number of signatures that must be obtained to verify a signature.
    21  	GetThreshold() uint
    22  }
    23  
    24  // GetSignBytesFunc defines a function type which returns sign bytes for a given SignMode or an error.
    25  // It will generally be implemented as a closure which wraps whatever signable object signatures are
    26  // being verified against.
    27  type GetSignBytesFunc func(mode signing.SignMode) ([]byte, error)