fee

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

nolint

Index

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 ErrInsufficientFees() errors.TMError

func ErrSkipFees

func ErrSkipFees() errors.TMError

func ErrWrongFeeDenom

func ErrWrongFeeDenom(denom string) errors.TMError

func IsInsufficientFeesErr

func IsInsufficientFeesErr(err error) bool

func IsSkipFeesErr

func IsSkipFeesErr(err error) bool

func IsWrongFeeDenomErr

func IsWrongFeeDenomErr(err error) bool

func NewFee

func NewFee(tx sdk.Tx, fee coin.Coin, payer sdk.Actor) sdk.Tx

NewFee wraps a tx with a promised fee from this actor

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

func (Fee) Next

func (f Fee) Next() sdk.Tx

func (Fee) ValidateBasic

func (f Fee) ValidateBasic() error

nolint - TxInner Functions

func (Fee) Wrap

func (f Fee) Wrap() sdk.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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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