Documentation
¶
Index ¶
- Constants
- func DeductCoins(bankKeeper bankkeeper.Keeper, ctx sdk.Context, coins sdk.Coins, ...) error
- func SendTip(bankKeeper bankkeeper.Keeper, ctx sdk.Context, proposer sdk.AccAddress, ...) error
- type FeeMarketDeductDecorator
- func (dfd FeeMarketDeductDecorator) PayOutFeeAndRefundFeePay(ctx sdk.Context, feeTx sdk.FeeTx, fee, refund sdk.Coin) error
- func (dfd FeeMarketDeductDecorator) PayOutFeeAndTip(ctx sdk.Context, fee, tip sdk.Coin) error
- func (dfd FeeMarketDeductDecorator) PostHandle(ctx sdk.Context, tx sdk.Tx, simulate, success bool, next sdk.PostHandler) (sdk.Context, error)
Constants ¶
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.Keeper, 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).
Types ¶
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 NewFeeMarketDeductDecorator ¶
func NewFeeMarketDeductDecorator(ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fmk feemarketkeeper.Keeper, fpk feepaykeeper.Keeper, sk feemarkettypes.StakingKeeper) FeeMarketDeductDecorator
func (FeeMarketDeductDecorator) PayOutFeeAndRefundFeePay ¶
func (dfd FeeMarketDeductDecorator) PayOutFeeAndRefundFeePay(ctx sdk.Context, feeTx sdk.FeeTx, fee, refund sdk.Coin) error
PayOutFeeAndRefundFeePay handles the payout for a feepay-covered tx:
- the consumed fee is deducted as usual (distributed or soft-burned per params.DistributeFees);
- the unused-gas remainder of the escrow is refunded from the feemarket-fee-collector back to the x/feepay module account and re-credited to the executing contract's feepay balance.
No proposer tip is generated for feepay txs.
func (FeeMarketDeductDecorator) PayOutFeeAndTip ¶
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.