Documentation ¶
Index ¶
- Constants
- Variables
- func DeductFees(bankKeeper types.BankKeeper, ctx sdk.Context, acc types.AccountI, ...) error
- func GetBurnFeePortion(burnFactor sdk.Dec, fee sdk.Coins) sdk.Coins
- func GetResourceTaxableMsgFee(ctx sdk.Context, msg *resourcetypes.MsgCreateResource) (sdk.Coins, sdk.Coins, bool)
- func GetRewardPortion(total sdk.Coins, burnPortion sdk.Coins) sdk.Coins
- func GetTaxableMsg(msg interface{}) bool
- func GetTaxableMsgFeeWithBurnPortion(ctx sdk.Context, msg interface{}) (sdk.Coins, sdk.Coins, bool)
- func IsSufficientFee(ctx sdk.Context, tax, reward, burn, feeProvided sdk.Coins, gasRequested int64) (bool, int64, error)
- func IsTaxableTx(ctx sdk.Context, didKeeper DidKeeper, resourceKeeper ResourceKeeper, tx sdk.Tx) (bool, sdk.Coins, sdk.Coins)
- func IsTaxableTxLite(tx sdk.Tx) bool
- func SumDistributionFee(distrFeeAlloc DistributionFeeAllocation) sdk.Coins
- func ValidateDistributionFee(fee sdk.Coins, distrFeeAlloc DistributionFeeAllocation) error
- type BankKeeper
- type BurnFactor
- type DeductFeeDecorator
- type DidKeeper
- type DistributionFeeAllocation
- type ResourceKeeper
- type TaxableMsgFee
- type TxFeeChecker
Constants ¶
View Source
const ( BurnFeePortion int = iota RewardsFeePortion FeePortionCount )
View Source
const ( MsgCreateDidDoc int = iota MsgUpdateDidDoc MsgDeactivateDidDoc MsgCreateResourceDefault MsgCreateResourceImage MsgCreateResourceJson TaxableMsgFeeCount )
View Source
const ( BurnFactorDid int = iota BurnFactorResource BurnFactorCount )
Variables ¶
View Source
var BurnFactors = BurnFactor{ BurnFactorDid: sdk.NewDec(0), BurnFactorResource: sdk.NewDec(0), }
View Source
var TaxableMsgFees = TaxableMsgFee{ MsgCreateDidDoc: (sdk.Coins)(nil), MsgUpdateDidDoc: (sdk.Coins)(nil), MsgDeactivateDidDoc: (sdk.Coins)(nil), MsgCreateResourceDefault: (sdk.Coins)(nil), MsgCreateResourceImage: (sdk.Coins)(nil), MsgCreateResourceJson: (sdk.Coins)(nil), }
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 GetResourceTaxableMsgFee ¶
func GetResourceTaxableMsgFee(ctx sdk.Context, msg *resourcetypes.MsgCreateResource) (sdk.Coins, sdk.Coins, bool)
func GetTaxableMsg ¶
func GetTaxableMsg(msg interface{}) bool
func IsSufficientFee ¶
func IsTaxableTx ¶
func IsTaxableTxLite ¶
func SumDistributionFee ¶
func SumDistributionFee(distrFeeAlloc DistributionFeeAllocation) sdk.Coins
func ValidateDistributionFee ¶
func ValidateDistributionFee(fee sdk.Coins, distrFeeAlloc DistributionFeeAllocation) error
Types ¶
type BankKeeper ¶
type BankKeeper interface { 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, recipientModule string, amt sdk.Coins) error BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error }
type BurnFactor ¶
type BurnFactor = [BurnFactorCount]sdk.Dec
type DeductFeeDecorator ¶
type DeductFeeDecorator struct {
// contains filtered or unexported fields
}
DeductFeeDecorator 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 NewDeductFeeDecorator ¶
func NewDeductFeeDecorator(ak ante.AccountKeeper, bk BankKeeper, fk ante.FeegrantKeeper, tfc TxFeeChecker) DeductFeeDecorator
func (DeductFeeDecorator) AnteHandle ¶
type DistributionFeeAllocation ¶
type DistributionFeeAllocation = [FeePortionCount]sdk.Coins
func GetDistributionFee ¶
type ResourceKeeper ¶
type ResourceKeeper interface {
GetParams(ctx sdk.Context) (params resourcetypes.FeeParams)
}
type TaxableMsgFee ¶
type TaxableMsgFee = [TaxableMsgFeeCount]sdk.Coins
Click to show internal directories.
Click to hide internal directories.