signerextraction

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

README

Signer Extraction Adapter (SEA)

Overview

The Signer Extraction Adapter is utilized to retrieve the signature information of a given transaction. This is purposefully built to allow application developers to retrieve signer information in the case where the default Cosmos SDK signature information is not applicable.

Utilization within the Block SDK

Each lane can configure it's own Signer Extraction Adapter (SEA). However, for almost all cases each lane will have the same SEA. The SEA is utilized to retrieve the address of the signer and nonce of the transaction. It's utilized by each lane's mempool to retrieve signer information as transactions are being inserted and for logging purposes as a proposal is being created / verified.

Configuration

To extend and implement a new SEA, the following interface must be implemented:

// Adapter is an interface used to determine how the signers of a transaction should be extracted
// from the transaction.
type Adapter interface {
	GetSigners(sdk.Tx) ([]SignerData, error)
}

The GetSigners method is responsible for extracting the signer information from the transaction. The SignerData struct is defined as follows:

type SignerData struct {
	Signer   sdk.AccAddress
	Sequence uint64
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	GetSigners(sdk.Tx) ([]SignerData, error)
}

Adapter is an interface used to determine how the signers of a transaction should be extracted from the transaction.

type DefaultAdapter

type DefaultAdapter struct{}

DefaultSignerExtractionAdapter is the default implementation of SignerExtractionAdapter. It extracts the signers from a cosmos-sdk tx via GetSignaturesV2.

func NewDefaultAdapter

func NewDefaultAdapter() DefaultAdapter

func (DefaultAdapter) GetSigners

func (DefaultAdapter) GetSigners(tx sdk.Tx) ([]SignerData, error)

type SignerData

type SignerData struct {
	Signer   sdk.AccAddress
	Sequence uint64
}

func NewSignerData added in v1.3.0

func NewSignerData(signer sdk.AccAddress, sequence uint64) SignerData

NewSignerData returns a new SignerData instance.

func (SignerData) String added in v1.3.0

func (s SignerData) String() string

String implements the fmt.Stringer interface.

Jump to

Keyboard shortcuts

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