Documentation
¶
Index ¶
- func DefaultSigVerificationGasConsumer(ctx sdk.Context, sig txsigning.SignatureV2, params types.Params) error
- func NewAnteHandler(options HandlerOptions) sdk.AnteHandler
- func NewNormalTxAnteHandlerEip712(options HandlerOptions) sdk.AnteHandler
- func Recover(logger tmlog.Logger, err *error)
- func VerifySignature(pubKey cryptotypes.PubKey, signerData authsigning.SignerData, ...) error
- type Eip712SigVerificationDecorator
- type HandlerOptions
- type MempoolFeeDecorator
- type RejectExtensionOptionsDecorator
- type SetPubKeyDecorator
- type SigGasConsumeDecorator
- type SignatureVerificationGasConsumer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultSigVerificationGasConsumer ¶
func DefaultSigVerificationGasConsumer(ctx sdk.Context, sig txsigning.SignatureV2, params types.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
func NewNormalTxAnteHandlerEip712 ¶
func NewNormalTxAnteHandlerEip712(options HandlerOptions) sdk.AnteHandler
func VerifySignature ¶
func VerifySignature( pubKey cryptotypes.PubKey, signerData authsigning.SignerData, sigData signing.SignatureData, _ 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 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 evmtypes.AccountKeeper, signModeHandler authsigning.SignModeHandler) 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 evmtypes.AccountKeeper
BankKeeper evmtypes.BankKeeper
EvmKeeper ethv1.EVMKeeper
EvmKeeperV0 ethv0.EVMKeeper
FeeMarketKeeperV0 ethv0.FeeMarketKeeper
SignModeHandler authsigning.SignModeHandler
SigGasConsumer SignatureVerificationGasConsumer
MaxTxGasWanted uint64
BypassMinFeeMsgTypes []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
type MempoolFeeDecorator ¶
type MempoolFeeDecorator struct {
BypassMinFeeMsgTypes []string
}
MempoolFeeDecorator will check if the transaction's fee is at least as large as the local validator's minimum gasFee (defined in validator config).
If fee is too low, decorator returns error and tx is rejected from mempool. Note this only applies when ctx.CheckTx = true. If fee is high enough or not CheckTx, then call next AnteHandler.
CONTRACT: Tx must implement FeeTx to use MempoolFeeDecorator
func NewMempoolFeeDecorator ¶
func NewMempoolFeeDecorator(bypassMsgTypes []string) MempoolFeeDecorator
func (MempoolFeeDecorator) AnteHandle ¶
type RejectExtensionOptionsDecorator ¶
type RejectExtensionOptionsDecorator struct{}
RejectExtensionOptionsDecorator is an AnteDecorator that rejects all extension options which can optionally be included in protobuf transactions. Users that need extension options should create a custom AnteHandler chain that handles needed extension options properly and rejects unknown ones.
func NewRejectExtensionOptionsDecorator ¶
func NewRejectExtensionOptionsDecorator() RejectExtensionOptionsDecorator
NewRejectExtensionOptionsDecorator creates a new RejectExtensionOptionsDecorator
func (RejectExtensionOptionsDecorator) AnteHandle ¶
func (r RejectExtensionOptionsDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)
AnteHandle implements the AnteDecorator.AnteHandle method
type SetPubKeyDecorator ¶
type SetPubKeyDecorator struct {
// contains filtered or unexported fields
}
SetPubKeyDecorator sets PubKeys in context for any signer which does not already have pubkey set PubKeys must be set in context for all signers before any other sigverify decorators run CONTRACT: Tx must implement SigVerifiableTx interface
func NewSetPubKeyDecorator ¶
func NewSetPubKeyDecorator(ak ante.AccountKeeper) SetPubKeyDecorator
func (SetPubKeyDecorator) AnteHandle ¶
type SigGasConsumeDecorator ¶
type SigGasConsumeDecorator struct {
// contains filtered or unexported fields
}
Consume parameter-defined amount of gas for each signature according to the passed-in SignatureVerificationGasConsumer function before calling the next AnteHandler CONTRACT: Pubkeys are set in context for all signers before this decorator runs CONTRACT: Tx must implement SigVerifiableTx interface
func NewSigGasConsumeDecorator ¶
func NewSigGasConsumeDecorator(ak ante.AccountKeeper, sigGasConsumer SignatureVerificationGasConsumer) SigGasConsumeDecorator