ante

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: LGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SettlementBasicGasCost        uint64 = 10000
	SettlementCreateTenantGasCost uint64 = 1000000000000
)

Variables

This section is empty.

Functions

func CalculateFees

func CalculateFees(ofp sdk.Dec, fees sdk.Coins) (gasFees, oracleFees sdk.Coins)

CalculateFees calculates gas fees and oracle fees from the given fees.

func DeductFees

func DeductFees(bankKeeper authtypes.BankKeeper, settlementKeeper SettlementKeeper, ctx sdk.Context, acc authtypes.AccountI, fees sdk.Coins) error

DeductFees deducts fees from the given account.

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 NewPostHandler

func NewPostHandler(options HandlerOptions) sdk.AnteHandler

Types

type DeductFeeDecorator

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

DeductFeeDecorator deducts fees from the first signer of the tx If the first signer does not have the funds to pay for the fees, return with InsufficientFunds error Call next AnteHandler if fees successfully deducted CONTRACT: Tx must implement FeeTx interface to use DeductFeeDecorator

func (DeductFeeDecorator) AnteHandle

func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

type HandlerOptions

type HandlerOptions struct {
	Cdc                    codec.BinaryCodec
	AccountKeeper          evmtypes.AccountKeeper
	BankKeeper             evmtypes.BankKeeper
	DistributionKeeper     anteutils.DistributionKeeper
	IBCKeeper              *ibckeeper.Keeper
	StakingKeeper          anteutils.StakingKeeper
	FeeMarketKeeper        evmante.FeeMarketKeeper
	EvmKeeper              evmante.EVMKeeper
	FeegrantKeeper         ante.FeegrantKeeper
	SettlementKeeper       SettlementKeeper
	ExtensionOptionChecker ante.ExtensionOptionChecker
	SignModeHandler        authsigning.SignModeHandler
	SigGasConsumer         func(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
	MaxTxGasWanted         uint64
	TxFeeChecker           anteutils.TxFeeChecker
}

HandlerOptions defines the list of module keepers required to run the Settlus AnteHandler decorators.

func (HandlerOptions) Validate

func (options HandlerOptions) Validate() error

type RejectMessagesDecorator

type RejectMessagesDecorator struct{}

RejectMessagesDecorator prevents invalid msg types from being executed

func (RejectMessagesDecorator) AnteHandle

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

AnteHandle rejects messages that requires ethereum-specific authentication. For example `MsgEthereumTx` requires fee to be deducted in the antehandler in order to perform the refund.

type SettlementGasConsumeDecorator

type SettlementGasConsumeDecorator struct {
}

SettlementGasConsumeDecorator is used as a post-handler for settlement tx, designed to allocate a constant amount of gas regardless of the gas consumed during execution.

func NewSettlementGasConsumeDecorator

func NewSettlementGasConsumeDecorator() SettlementGasConsumeDecorator

func (SettlementGasConsumeDecorator) AnteHandle

func (SettlementGasConsumeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

type SettlementKeeper

type SettlementKeeper interface {
	GetParams(ctx sdk.Context) (params types.Params)
}

type SettlementSetUpContextDecorator

type SettlementSetUpContextDecorator struct {
}

func NewSettlementSetUpContextDecorator

func NewSettlementSetUpContextDecorator() SettlementSetUpContextDecorator

func (SettlementSetUpContextDecorator) AnteHandle

func (SettlementSetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

Jump to

Keyboard shortcuts

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