Documentation ¶
Index ¶
- Variables
- func DeductFees(bankKeeper types.BankKeeper, ctx sdk.Context, acc types.AccountI, ...) error
- func FilterMsgAndComputeTax(ctx sdk.Context, tk TreasuryKeeper, msgs ...sdk.Msg) sdk.Coins
- func HandleCheckMinInitialDeposit(ctx sdk.Context, msg sdk.Msg, govKeeper govkeeper.Keeper, ...) (err error)
- func IsMsgSubmitProposal(msg sdk.Msg) bool
- func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
- type BankKeeper
- type DistrKeeper
- type FeeDecorator
- type GovKeeper
- type HandlerOptions
- type MinInitialDepositDecorator
- type OracleKeeper
- type SpammingPreventionDecorator
- type TreasuryKeeper
Constants ¶
This section is empty.
Variables ¶
var IBCRegexp = regexp.MustCompile("^ibc/[a-fA-F0-9]{64}$")
Functions ¶
func DeductFees ¶
func DeductFees(bankKeeper types.BankKeeper, ctx sdk.Context, acc types.AccountI, fees sdk.Coins) error
DeductFees deducts fees from the given account.
func FilterMsgAndComputeTax ¶
FilterMsgAndComputeTax computes the stability tax on messages.
func HandleCheckMinInitialDeposit ¶
func HandleCheckMinInitialDeposit(ctx sdk.Context, msg sdk.Msg, govKeeper govkeeper.Keeper, treasuryKeeper TreasuryKeeper) (err error)
HandleCheckMinInitialDeposit
func IsMsgSubmitProposal ¶
IsMsgSubmitProposal checks whether the input msg is a MsgSubmitProposal
func NewAnteHandler ¶
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, and deducts fees from the first signer.
Types ¶
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 SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error }
BankKeeper defines the contract needed for supply related APIs (noalias)
type DistrKeeper ¶
type FeeDecorator ¶
type FeeDecorator struct {
// contains filtered or unexported fields
}
FeeDecorator 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 NewFeeDecorator ¶
func NewFeeDecorator(ak ante.AccountKeeper, bk BankKeeper, fk ante.FeegrantKeeper, tk TreasuryKeeper) FeeDecorator
func (FeeDecorator) AnteHandle ¶
func (FeeDecorator) BurnTaxSplit ¶
BurnTaxSplit splits
type HandlerOptions ¶
type HandlerOptions struct { AccountKeeper ante.AccountKeeper BankKeeper BankKeeper ExtensionOptionChecker ante.ExtensionOptionChecker FeegrantKeeper ante.FeegrantKeeper OracleKeeper OracleKeeper TreasuryKeeper TreasuryKeeper SignModeHandler signing.SignModeHandler SigGasConsumer ante.SignatureVerificationGasConsumer TxFeeChecker ante.TxFeeChecker IBCKeeper ibckeeper.Keeper DistributionKeeper distributionkeeper.Keeper GovKeeper govkeeper.Keeper WasmConfig *wasmtypes.WasmConfig TXCounterStoreKey storetypes.StoreKey DyncommKeeper dyncommkeeper.Keeper StakingKeeper *stakingkeeper.Keeper Cdc codec.BinaryCodec }
HandlerOptions are the options required for constructing a default SDK AnteHandler.
type MinInitialDepositDecorator ¶
type MinInitialDepositDecorator struct {
// contains filtered or unexported fields
}
MinInitialDeposit Decorator will check Initial Deposits for MsgSubmitProposal
func NewMinInitialDepositDecorator ¶
func NewMinInitialDepositDecorator(govKeeper govkeeper.Keeper, treasuryKeeper TreasuryKeeper) MinInitialDepositDecorator
NewMinInitialDeposit returns new min initial deposit decorator instance
func (MinInitialDepositDecorator) AnteHandle ¶
func (midd MinInitialDepositDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)
AnteHandle handles checking MsgSubmitProposal
type OracleKeeper ¶
type OracleKeeper interface {
ValidateFeeder(ctx sdk.Context, feederAddr sdk.AccAddress, validatorAddr sdk.ValAddress) error
}
OracleKeeper for feeder validation
type SpammingPreventionDecorator ¶
type SpammingPreventionDecorator struct {
// contains filtered or unexported fields
}
SpammingPreventionDecorator will check if the transaction's gas is smaller than configured hard cap
func NewSpammingPreventionDecorator ¶
func NewSpammingPreventionDecorator(oracleKeeper OracleKeeper) SpammingPreventionDecorator
NewSpammingPreventionDecorator returns new spamming prevention decorator instance
func (SpammingPreventionDecorator) AnteHandle ¶
func (spd SpammingPreventionDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)
AnteHandle handles msg tax fee checking
func (SpammingPreventionDecorator) CheckOracleSpamming ¶
CheckOracleSpamming check whether the msgs are spamming purpose or not
type TreasuryKeeper ¶
type TreasuryKeeper interface { RecordEpochTaxProceeds(ctx sdk.Context, delta sdk.Coins) GetTaxRate(ctx sdk.Context) (taxRate sdk.Dec) GetTaxCap(ctx sdk.Context, denom string) (taxCap sdk.Int) GetBurnSplitRate(ctx sdk.Context) sdk.Dec HasBurnTaxExemptionAddress(ctx sdk.Context, addresses ...string) bool HasBurnTaxExemptionContract(ctx sdk.Context, address string) bool GetMinInitialDepositRatio(ctx sdk.Context) sdk.Dec }
TreasuryKeeper for tax charging & recording