post

package
v1.0.2-sdk47 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeductCoins

func DeductCoins(bankKeeper BankKeeper, ctx sdk.Context, acc authtypes.AccountI, 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 sent to the feemarket fee collector account (causes coins to be burned).

func SendTip

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

SendTip sends a tip to the current block proposer.

Types

type AccountKeeper

type AccountKeeper interface {
	GetParams(ctx sdk.Context) (params authtypes.Params)
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
	SetAccount(ctx sdk.Context, acc authtypes.AccountI)
	GetModuleAddress(moduleName string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, name string) authtypes.ModuleAccountI
	NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authtypes.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 sdk.Context, coins ...sdk.Coin) error
	SendCoins(ctx sdk.Context, from, to sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
}

BankKeeper defines the contract needed for supply related APIs.

type FeeGrantKeeper

type FeeGrantKeeper interface {
	UseGrantedFees(ctx sdk.Context, granter, grantee sdk.AccAddress, fee sdk.Coins, msgs []sdk.Msg) error
}

FeeGrantKeeper defines the expected feegrant keeper.

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) DeductFeeAndTip

func (dfd FeeMarketDeductDecorator) DeductFeeAndTip(ctx sdk.Context, sdkTx sdk.Tx, fee, tip sdk.Coin) error

DeductFeeAndTip 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)
}

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