post

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 15

Documentation

Index

Constants

View Source
const BankSendGasConsumption = 12490

BankSendGasConsumption is the gas consumption of the bank sends that occur during feemarket handler execution.

Variables

This section is empty.

Functions

func DeductCoins

func DeductCoins(bankKeeper BankKeeper, ctx sdk.Context, coins sdk.Coins, distributeFees bool) error

DeductCoins deducts coins from the given account. Coins can be sent to the default fee collector ( causes coins to be distributed to stakers) or kept in the fee collector account (soft burn).

func SendTip

func SendTip(bankKeeper BankKeeper, ctx sdk.Context, proposer sdk.AccAddress, coins sdk.Coins) error

SendTip sends a tip to the current block proposer.

Types

type AccountKeeper

type AccountKeeper interface {
	GetParams(ctx context.Context) (params authtypes.Params)
	GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
	SetAccount(ctx context.Context, acc sdk.AccountI)
	GetModuleAddress(moduleName string) sdk.AccAddress
	GetModuleAccount(ctx context.Context, name string) sdk.ModuleAccountI
	NewAccountWithAddress(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
}

AccountKeeper defines the contract needed for AccountKeeper related APIs. Interface provides support to use non-sdk AccountKeeper for AnteHandler's decorators.

type BankKeeper

type BankKeeper interface {
	IsSendEnabledCoins(ctx context.Context, coins ...sdk.Coin) error
	SendCoins(ctx context.Context, from, to sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
	SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error
	SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
}

BankKeeper defines the contract needed for supply related APIs.

type FeeMarketDeductDecorator

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

FeeMarketDeductDecorator deducts fees from the fee payer based off of the current state of the feemarket. The fee payer is the fee granter (if specified) or first signer of the tx. If the fee payer does not have the funds to pay for the fees, return an InsufficientFunds error. If there is an excess between the given fee and the on-chain min base fee is given as a tip. Call next PostHandler if fees successfully deducted. CONTRACT: Tx must implement FeeTx interface

func (FeeMarketDeductDecorator) PayOutFeeAndTip added in v1.1.0

func (dfd FeeMarketDeductDecorator) PayOutFeeAndTip(ctx sdk.Context, fee, tip sdk.Coin) error

PayOutFeeAndTip deducts the provided fee and tip from the fee payer. If the tx uses a feegranter, the fee granter address will pay the fee instead of the tx signer.

func (FeeMarketDeductDecorator) PostHandle

func (dfd FeeMarketDeductDecorator) PostHandle(ctx sdk.Context, tx sdk.Tx, simulate, success bool, next sdk.PostHandler) (sdk.Context, error)

PostHandle deducts the fee from the fee payer based on the min base fee and the gas consumed in the gasmeter. If there is a difference between the provided fee and the min-base fee, the difference is paid as a tip. Fees are sent to the x/feemarket fee-collector address.

type FeeMarketKeeper

type FeeMarketKeeper interface {
	GetState(ctx sdk.Context) (feemarkettypes.State, error)
	GetParams(ctx sdk.Context) (feemarkettypes.Params, error)
	SetParams(ctx sdk.Context, params feemarkettypes.Params) error
	SetState(ctx sdk.Context, state feemarkettypes.State) error
	ResolveToDenom(ctx sdk.Context, coin sdk.DecCoin, denom string) (sdk.DecCoin, error)
	GetMinGasPrice(ctx sdk.Context, denom string) (sdk.DecCoin, error)
	GetEnabledHeight(ctx sdk.Context) (int64, error)
}

FeeMarketKeeper defines the expected feemarket keeper.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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