Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func ErrExpired() errors.TMError
- func ErrNoChain() errors.TMError
- func ErrWrongChain(chain string) errors.TMError
- func IsExpiredErr(err error) bool
- func IsNoChainErr(err error) bool
- func IsWrongChainErr(err error) bool
- func NewChainTx(chainID string, expires int64, tx sdk.Tx) sdk.Tx
- func NewMultiTx(txs ...sdk.Tx) sdk.Tx
- func NewPriceShowTx(gasAllocated, gasPayment int64) sdk.Tx
- type Chain
- type ChainTx
- type Logger
- func (Logger) CheckTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx, next sdk.Checker) (res sdk.CheckResult, err error)
- func (Logger) DeliverTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx, next sdk.Deliver) (res sdk.DeliverResult, err error)
- func (Logger) InitState(l log.Logger, store state.SimpleDB, module, key, value string, ...) (string, error)
- func (Logger) InitValidate(l log.Logger, store state.SimpleDB, vals []*abci.Validator, ...)
- func (Logger) Name() string
- type MultiTx
- type Multiplexer
- type PriceHandler
- type PriceShowTx
- type ValChangeTx
- type ValSetHandler
Constants ¶
const ( NameVal = "val" NamePrice = "price" TypeValChange = NameVal + "/change" ByteValChange = 0xfe TypePriceShow = NamePrice + "/show" BytePriceShow = 0xfd )
nolint
const ( // for utils... ByteMultiTx = 0x2 ByteChainTx = 0x3 )
nolint
const ( TypeMultiTx = NameMultiplexer + "/tx" TypeChainTx = NameChain + "/tx" )
nolint
const (
NameChain = "chain"
)
nolint
const (
NameLogger = "lggr"
)
nolint
const (
NameMultiplexer = "mplx"
)
nolint
Variables ¶
var PriceData = []byte{0xCA, 0xFE}
PriceData is the data we ping back
Functions ¶
func NewChainTx ¶
NewChainTx wraps a particular tx with the ChainTx wrapper, to enforce chain and height
Types ¶
type Chain ¶
type Chain struct { stack.PassInitState stack.PassInitValidate }
Chain enforces that this tx was bound to the named chain
func (Chain) CheckTx ¶
func (c Chain) CheckTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx, next sdk.Checker) (res sdk.CheckResult, err error)
CheckTx makes sure we are on the proper chain - fulfills Middlware interface
type ChainTx ¶
type ChainTx struct { // name of chain, must be [A-Za-z0-9_-]+ ChainID string `json:"chain_id"` // block height at which it is no longer valid, 0 means no expiration ExpiresAt int64 `json:"expires_at"` Tx sdk.Tx `json:"tx"` }
ChainTx locks this tx to one chainTx, wrap with this before signing
type Logger ¶
type Logger struct{}
Logger catches any panics and returns them as errors instead
func (Logger) CheckTx ¶
func (Logger) CheckTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx, next sdk.Checker) (res sdk.CheckResult, err error)
CheckTx logs time and result - fulfills Middlware interface
func (Logger) DeliverTx ¶
func (Logger) DeliverTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx, next sdk.Deliver) (res sdk.DeliverResult, err error)
DeliverTx logs time and result - fulfills Middlware interface
func (Logger) InitState ¶
func (Logger) InitState(l log.Logger, store state.SimpleDB, module, key, value string, next sdk.InitStater) (string, error)
InitState logs time and result - fulfills Middlware interface
type MultiTx ¶
MultiTx - a transaction containing multiple transactions
type Multiplexer ¶
type Multiplexer struct { stack.PassInitState stack.PassInitValidate }
Multiplexer grabs a MultiTx and sends them sequentially down the line
func (Multiplexer) CheckTx ¶
func (Multiplexer) CheckTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx, next sdk.Checker) (res sdk.CheckResult, err error)
CheckTx splits the input tx and checks them all - fulfills Middlware interface
func (Multiplexer) DeliverTx ¶
func (Multiplexer) DeliverTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx, next sdk.Deliver) (res sdk.DeliverResult, err error)
DeliverTx splits the input tx and checks them all - fulfills Middlware interface
func (Multiplexer) Name ¶
func (Multiplexer) Name() string
Name of the module - fulfills Middleware interface
type PriceHandler ¶
type PriceHandler struct { sdk.NopInitState sdk.NopInitValidate }
PriceHandler returns checktx results based on the input
func (PriceHandler) CheckTx ¶
func (PriceHandler) CheckTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx) (res sdk.CheckResult, err error)
func (PriceHandler) DeliverTx ¶
func (PriceHandler) DeliverTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx) (res sdk.DeliverResult, err error)
func (PriceHandler) Name ¶
func (PriceHandler) Name() string
type PriceShowTx ¶
PriceShowTx lets us bounce back a given fee/gas on CheckTx
func (PriceShowTx) ValidateBasic ¶
func (v PriceShowTx) ValidateBasic() error
func (PriceShowTx) Wrap ¶
func (p PriceShowTx) Wrap() sdk.Tx
type ValChangeTx ¶
func (ValChangeTx) ValidateBasic ¶
func (v ValChangeTx) ValidateBasic() error
func (ValChangeTx) Wrap ¶
func (v ValChangeTx) Wrap() sdk.Tx
type ValSetHandler ¶
type ValSetHandler struct { sdk.NopCheck sdk.NopInitState sdk.NopInitValidate }
func (ValSetHandler) DeliverTx ¶
func (ValSetHandler) DeliverTx(ctx sdk.Context, store state.SimpleDB, tx sdk.Tx) (res sdk.DeliverResult, err error)
func (ValSetHandler) Name ¶
func (ValSetHandler) Name() string