Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func ErrInsufficientFees() errors.TMError
- func ErrSkipFees() errors.TMError
- func ErrWrongFeeDenom(denom string) errors.TMError
- func IsInsufficientFeesErr(err error) bool
- func IsSkipFeesErr(err error) bool
- func IsWrongFeeDenomErr(err error) bool
- func NewFee(tx sdk.Tx, fee coin.Coin, payer sdk.Actor) sdk.Tx
- type Fee
- type SimpleFeeMiddleware
- func (h SimpleFeeMiddleware) CheckTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx, next sdk.Checker) (res sdk.CheckResult, err error)
- func (h SimpleFeeMiddleware) DeliverTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx, next sdk.Deliver) (res sdk.DeliverResult, err error)
- func (SimpleFeeMiddleware) Name() string
Constants ¶
View Source
const ( ByteFees = 0x28 TypeFees = NameFee + "/tx" )
nolint
View Source
const NameFee = "fee"
NameFee - namespace for the fee module
Variables ¶
View Source
var Bank = sdk.Actor{App: NameFee, Address: []byte("bank")}
Bank is a default location for the fees, but pass anything into the middleware constructor
Functions ¶
func ErrInsufficientFees ¶
func ErrSkipFees ¶
func ErrWrongFeeDenom ¶
func IsInsufficientFeesErr ¶
func IsSkipFeesErr ¶
func IsWrongFeeDenomErr ¶
Types ¶
type Fee ¶
type Fee struct { // Gas coin.Coin `json:"gas"` // ????? Fee coin.Coin `json:"fee"` Payer sdk.Actor `json:"payer"` // the address who pays the fee Tx sdk.Tx `json:"tx"` }
Fee attaches a fee payment to the embedded tx
type SimpleFeeMiddleware ¶
type SimpleFeeMiddleware struct { // the fee must be the same denomination and >= this amount // if the amount is 0, then the fee tx wrapper is optional MinFee coin.Coin // all fees go here, which could be a dump (Bank) or something reachable // by other app logic Collector sdk.Actor stack.PassInitState stack.PassInitValidate }
SimpleFeeMiddleware - middleware for fee checking, constant amount It used modules.coin to move the money
func NewSimpleFeeMiddleware ¶
func NewSimpleFeeMiddleware(minFee coin.Coin, collector sdk.Actor) SimpleFeeMiddleware
NewSimpleFeeMiddleware returns a fee handler with a fixed minimum fee.
If minFee is 0, then the FeeTx is optional
func (SimpleFeeMiddleware) CheckTx ¶
func (h SimpleFeeMiddleware) CheckTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx, next sdk.Checker) (res sdk.CheckResult, err error)
CheckTx - check the transaction
func (SimpleFeeMiddleware) DeliverTx ¶
func (h SimpleFeeMiddleware) DeliverTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx, next sdk.Deliver) (res sdk.DeliverResult, err error)
DeliverTx - send the fee handler transaction
func (SimpleFeeMiddleware) Name ¶
func (SimpleFeeMiddleware) Name() string
Name - return the namespace for the fee module
Click to show internal directories.
Click to hide internal directories.