Documentation ¶
Overview ¶
Package ante defines the SDK auth module's AnteHandler as well as an internal AnteHandler for an Ethereum transaction (i.e MsgEthereumTx).
During CheckTx, the transaction is passed through a series of pre-message execution validation checks such as signature and account verification in addition to minimum fees being checked. Otherwise, during DeliverTx, the transaction is simply passed to the EVM which will also perform the same series of checks. The distinction is made in CheckTx to prevent spam and DoS attacks.
Index ¶
- func DefaultSigVerificationGasConsumer(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
- func NewAnteHandler(ak AccountKeeper, bankKeeper BankKeeper, ...) sdk.AnteHandler
- func Recover(err *error)
- func VerifySignature(pubKey cryptotypes.PubKey, signerData authsigning.SignerData, ...) error
- type AccountKeeper
- type BankKeeper
- type Eip712SigVerificationDecorator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultSigVerificationGasConsumer ¶
func DefaultSigVerificationGasConsumer( meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params, ) error
DefaultSigVerificationGasConsumer is the default implementation of SignatureVerificationGasConsumer. It consumes gas for signature verification based upon the public key type. The cost is fetched from the given params and is matched by the concrete type.
func NewAnteHandler ¶
func NewAnteHandler( ak AccountKeeper, bankKeeper BankKeeper, signModeHandler authsigning.SignModeHandler, ) sdk.AnteHandler
NewAnteHandler returns an ante handler responsible for attempting to route an Ethereum or SDK transaction to an internal ante handler for performing transaction-level processing (e.g. fee payment, signature verification) before being passed onto it's respective handler.
func VerifySignature ¶
func VerifySignature( pubKey cryptotypes.PubKey, signerData authsigning.SignerData, sigData signing.SignatureData, handler authsigning.SignModeHandler, tx authsigning.Tx, ) error
VerifySignature verifies a transaction signature contained in SignatureData abstracting over different signing modes and single vs multi-signatures.
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { authante.AccountKeeper NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI SetAccount(ctx sdk.Context, account authtypes.AccountI) }
AccountKeeper defines an expected keeper interface for the auth module's AccountKeeper
type BankKeeper ¶
type BankKeeper interface { authtypes.BankKeeper GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin SetBalance(ctx sdk.Context, addr sdk.AccAddress, balance sdk.Coin) error }
BankKeeper defines an expected keeper interface for the bank module's Keeper
type Eip712SigVerificationDecorator ¶
type Eip712SigVerificationDecorator struct {
// contains filtered or unexported fields
}
Verify all signatures for a tx and return an error if any are invalid. Note, the Eip712SigVerificationDecorator decorator will not get executed on ReCheck.
CONTRACT: Pubkeys are set in context for all signers before this decorator runs CONTRACT: Tx must implement SigVerifiableTx interface
func NewEip712SigVerificationDecorator ¶
func NewEip712SigVerificationDecorator(ak AccountKeeper, signModeHandler authsigning.SignModeHandler) Eip712SigVerificationDecorator