Documentation ¶
Index ¶
Constants ¶
const BankSendGasConsumption = 12490 + 37325
BankSendGasConsumption is the gas consumption of the bank sends that occur during feemarket handler execution. 37325 is the additional gas consumed for burning the fees instead of just transferring them.
Variables ¶
This section is empty.
Functions ¶
func RefundTip ¶
func RefundTip(bankKeeper BankKeeper, ctx sdk.Context, feePayer sdk.AccAddress, coins sdk.Coins) error
RefundTip sends a tip to the txfee payer.
Types ¶
type BankKeeper ¶
type BankKeeper interface { bankkeeper.Keeper }
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. Excess between the given fee and the on-chain min base fee is refunded to payer. Call next PostHandler if fees successfully deducted. CONTRACT: Tx must implement FeeTx interface
func NewFeeMarketDeductDecorator ¶
func NewFeeMarketDeductDecorator(bk BankKeeper, fmk FeeMarketKeeper) FeeMarketDeductDecorator
func (FeeMarketDeductDecorator) BurnFeeAndRefund ¶
func (dfd FeeMarketDeductDecorator) BurnFeeAndRefund(ctx sdk.Context, fee, tip sdk.Coin, feePayer sdk.AccAddress, defaultFeeDenom string) error
BurnFeeAndRefund burns the fees and refunds the extra/tip to the fee payer.
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.