ante

package
v0.6.0-rc.7-hotfix Latest Latest
Warning

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

Go to latest
Published: Aug 28, 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 CalculateGasCost

func CalculateGasCost(tx sdk.Tx) (gas uint64)

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 IsSettlementTx

func IsSettlementTx(tx sdk.Tx) bool

func NewAnteHandler

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)

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.

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
	OracleKeeper           OracleKeeper
	ExtensionOptionChecker ante.ExtensionOptionChecker
	SignModeHandler        authsigning.SignModeHandler
	SigGasConsumer         func(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
	MaxTxGasWanted         uint64
	TxFeeChecker           ante.TxFeeChecker
}

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

func (HandlerOptions) Validate

func (options HandlerOptions) Validate() error

type OracleKeeper

type OracleKeeper interface {
	ValidateFeeder(ctx sdk.Context, feederAddr string, validatorAddr string) (bool, 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 SettlementKeeper

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

type SettlusSetUpContextDecorator

type SettlusSetUpContextDecorator struct{}

func NewSettlusSetUpContextDecorator

func NewSettlusSetUpContextDecorator() SettlusSetUpContextDecorator

func (SettlusSetUpContextDecorator) AnteHandle

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

type SettlusValidatorCheckDecorator

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

func NewSettlusValidatorCheckDecorator

func NewSettlusValidatorCheckDecorator(oracleKeeper OracleKeeper) SettlusValidatorCheckDecorator

func (SettlusValidatorCheckDecorator) AnteHandle

func (svcd SettlusValidatorCheckDecorator) 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