signing

package
v0.0.0-...-c20b1fc Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SignModeHandler

type SignModeHandler interface {
	// DefaultMode is the default mode that is to be used with this handler if no
	// other mode is specified. This can be useful for testing and CLI usage
	DefaultMode() signingv1beta1.SignMode

	// Modes is the list of modes supporting by this handler
	Modes() []signingv1beta1.SignMode

	// GetSignBytes returns the sign bytes for the provided SignMode, SignerData and Tx,
	// or an error
	GetSignBytes(mode signingv1beta1.SignMode, data SignerData, tx *txv1beta1.Tx) ([]byte, error)
}

SignModeHandler defines a interface to be implemented by types which will handle SignMode's by generating sign bytes from a Tx and SignerData

type SignModeHandlerMap

type SignModeHandlerMap struct {
	// contains filtered or unexported fields
}

SignModeHandlerMap is SignModeHandler that aggregates multiple SignModeHandler's into a single handler

func NewSignModeHandlerMap

func NewSignModeHandlerMap(defaultMode signingv1beta1.SignMode, handlers []SignModeHandler) SignModeHandlerMap

NewSignModeHandlerMap returns a new SignModeHandlerMap with the provided defaultMode and handlers

func (SignModeHandlerMap) DefaultMode

func (h SignModeHandlerMap) DefaultMode() signingv1beta1.SignMode

DefaultMode implements SignModeHandler.DefaultMode

func (SignModeHandlerMap) GetSignBytes

func (h SignModeHandlerMap) GetSignBytes(mode signingv1beta1.SignMode, data SignerData, tx *txv1beta1.Tx) ([]byte, error)

DefaultMode implements SignModeHandler.GetSignBytes

func (SignModeHandlerMap) Modes

Modes implements SignModeHandler.Modes

type SignerData

type SignerData struct {
	// The address of the signer.
	//
	// In case of multisigs, this should be the multisig's address.
	Address string

	// ChainID is the chain that this transaction is targeted
	ChainID string

	// AccountNumber is the account number of the signer.
	//
	// In case of multisigs, this should be the multisig account number.
	AccountNumber uint64

	// Sequence is the account sequence number of the signer that is used
	// for replay protection. This field is only useful for Legacy Amino signing,
	// since in SIGN_MODE_DIRECT the account sequence is already in the signer
	// info.
	//
	// In case of multisigs, this should be the multisig sequence.
	Sequence uint64

	// PubKey is the public key of the signer.
	//
	// In case of multisigs, this should be the pubkey of the member of the
	// multisig that is signing the current sign doc.
	PubKey fwcryptotypes.PubKey
}

SignerData is the specific information needed to sign a transaction that generally isn't included in the transaction body itself

Jump to

Keyboard shortcuts

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