ante

package
v0.0.0-...-a2f4e79 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 35 Imported by: 0

Documentation

Index

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(options HandlerOptions) 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 Recover

func Recover(logger tmlog.Logger, err *error)

func VerifySignature

func VerifySignature(
	pubKey cryptotypes.PubKey,
	signerData authsigning.SignerData,
	sigData signing.SignatureData,
	_ authsigning.SignModeHandler,
	tx authsigning.Tx,
	chain string,
	wk wasmxkeeper.Keeper,
	ctx sdk.Context,
	verifyBtcSigPath string,
) error

VerifySignature verifies a transaction signature contained in SignatureData abstracting over different signing modes and single vs multi-signatures.

Types

type Eip712SigVerificationDecorator

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

Eip712SigVerificationDecorator 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 ante.AccountKeeper,
	wk wasmxkeeper.Keeper,
	signModeHandler authsigning.SignModeHandler, chain string, verifyBtcSigPath string) Eip712SigVerificationDecorator

NewEip712SigVerificationDecorator creates a new Eip712SigVerificationDecorator

func (Eip712SigVerificationDecorator) AnteHandle

func (svd Eip712SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

AnteHandle handles validation of EIP712 signed cosmos txs. it is not run on RecheckTx

type HandlerOptions

type HandlerOptions struct {
	AccountKeeper   ante.AccountKeeper
	BankKeeper      authtypes.BankKeeper
	IBCKeeper       *ibckeeper.Keeper
	FeegrantKeeper  ante.FeegrantKeeper
	SignModeHandler authsigning.SignModeHandler
	SigGasConsumer  func(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
	TxFeeChecker    ante.TxFeeChecker
	WasmXKeeper     wasmxkeeper.Keeper

	VerifyBtcSigPath string
}

HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper, EVM Keeper and Fee Market Keeper.

func (HandlerOptions) Validate

func (options HandlerOptions) Validate() error

Jump to

Keyboard shortcuts

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