ante

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountKeeper

type AccountKeeper interface {
	GetParams(ctx sdk.Context) (params types.Params)
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
	SetAccount(ctx sdk.Context, acc types.AccountI)
	GetModuleAddress(moduleName string) sdk.AccAddress
}

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 {
	GetAllBalances(ctx sdk.Context, address sdk.AccAddress) sdk.Coins
	SpendableCoins(ctx sdk.Context, address sdk.AccAddress) sdk.Coins
}

type CorrectWrkChainFeeDecorator

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

CorrectWrkChainFeeDecorator checks if the correct fees have been sent to pay for a WRKChain register/record hash Tx, and if the fee paying account has sufficient funds to pay. It first checks if the Tx contains any WRKChain Msgs, and if not, continues on to the next AnteHandler in the chain. If a WRKChain Msg is detected, it then:

1. Checks sufficient fees have been included in the Tx, via the --fees flag 2. Checks the fee payer is the WRKChain owner 3. Checks if the fee payer has sufficient funds in their account to pay for it, including any locked enterprise und

If any of the checks fail, a suitable error is returned.

func NewCorrectWrkChainFeeDecorator

func NewCorrectWrkChainFeeDecorator(bankKeeper BankKeeper, accKeeper AccountKeeper, wrkchainKeeper WrkchainKeeper, enterpriseKeeper EnterpriseKeeper) CorrectWrkChainFeeDecorator

func (CorrectWrkChainFeeDecorator) AnteHandle

func (wfd CorrectWrkChainFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

type EnterpriseKeeper

type EnterpriseKeeper interface {
	GetLockedUndAmountForAccount(ctx sdk.Context, address sdk.AccAddress) sdk.Coin
}

type WrkchainKeeper

type WrkchainKeeper interface {
	GetZeroFeeAsCoin(ctx sdk.Context) sdk.Coin
	GetParamDenom(ctx sdk.Context) string
	GetRegistrationFeeAsCoin(ctx sdk.Context) sdk.Coin
	GetRecordFeeAsCoin(ctx sdk.Context) sdk.Coin
	GetPurchaseStorageFeeAsCoin(ctx sdk.Context) sdk.Coin
	GetMaxPurchasableSlots(ctx sdk.Context, wrkchainId uint64) uint64
}

Jump to

Keyboard shortcuts

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