Documentation ¶
Index ¶
- Variables
- func ToABCI(r Result) abci.Result
- type Actor
- type Actors
- type ByAll
- type CheckResult
- type Checker
- type CheckerFunc
- type Context
- type Deliver
- type DeliverFunc
- type DeliverResult
- type Handler
- type InitStateFunc
- type InitStater
- type InitValidateFunc
- type InitValidater
- type Named
- type NopCheck
- type NopDeliver
- type NopInitState
- type NopInitValidate
- type Result
- type Tx
- type TxInner
- type TxLayer
Constants ¶
This section is empty.
Variables ¶
var TxMapper = data.NewMapper(Tx{})
Functions ¶
Types ¶
type Actor ¶
type Actor struct { ChainID string `json:"chain"` // this is empty unless it comes from a different chain App string `json:"app"` // the app that the actor belongs to Address data.Bytes `json:"addr"` // arbitrary app-specific unique id }
Actor abstracts any address that can authorize actions, hold funds, or initiate any sort of transaction.
It doesn't just have to be a pubkey on this chain, it could stem from another app (like multi-sig account), or even another chain (via IBC)
type ByAll ¶
type ByAll []Actor
ByAll implements sort.Interface for []Actor. It sorts be the ChainID, followed by the App, followed by the Address
type CheckResult ¶
type CheckResult struct { Data data.Bytes Log string // GasAllocated is the maximum units of work we allow this tx to perform GasAllocated uint64 // GasPayment is the total fees for this tx (or other source of payment) GasPayment uint64 }
CheckResult captures any non-error abci result to make sure people use error for error cases
func NewCheck ¶
func NewCheck(gasAllocated uint64, log string) CheckResult
NewCheck sets the gas used and the response data but no more info these are the most common info needed to be set by the Handler
func (CheckResult) GetData ¶
func (r CheckResult) GetData() data.Bytes
func (CheckResult) GetLog ¶
func (r CheckResult) GetLog() string
type CheckerFunc ¶
CheckerFunc (like http.HandlerFunc) is a shortcut for making wrappers
func (CheckerFunc) CheckTx ¶
func (c CheckerFunc) CheckTx(ctx Context, store state.SimpleDB, tx Tx) (CheckResult, error)
type Context ¶
type Context interface { // context.Context log.Logger WithPermissions(perms ...Actor) Context HasPermission(perm Actor) bool GetPermissions(chain, app string) []Actor IsParent(ctx Context) bool Reset() Context ChainID() string BlockHeight() uint64 }
Context is an interface, so we can implement "secure" variants that rely on private fields to control the actions
type Deliver ¶
type Deliver interface {
DeliverTx(ctx Context, store state.SimpleDB, tx Tx) (DeliverResult, error)
}
Deliver performs the tx once it makes it in the block
type DeliverFunc ¶
DeliverFunc (like http.HandlerFunc) is a shortcut for making wrappers
func (DeliverFunc) DeliverTx ¶
func (c DeliverFunc) DeliverTx(ctx Context, store state.SimpleDB, tx Tx) (DeliverResult, error)
type DeliverResult ¶
DeliverResult captures any non-error abci result to make sure people use error for error cases
func (DeliverResult) GetData ¶
func (r DeliverResult) GetData() data.Bytes
func (DeliverResult) GetLog ¶
func (r DeliverResult) GetLog() string
type Handler ¶
type Handler interface { // Checker verifies there are valid fees and estimates work Checker // Deliver performs the tx once it makes it in the block Deliver // InitStater sets state from the genesis file InitStater // InitValidater sets the initial validator set InitValidater // Named ensures there is a name for the item Named }
Handler is anything that processes a transaction
type InitStateFunc ¶
InitStateFunc (like http.HandlerFunc) is a shortcut for making wrappers
type InitStater ¶
type InitStater interface {
InitState(l log.Logger, store state.SimpleDB, module, key, value string) (string, error)
}
InitStater sets state from the genesis file
type InitValidateFunc ¶
InitValidateFunc (like http.HandlerFunc) is a shortcut for making wrappers
func (InitValidateFunc) InitValidate ¶
type InitValidater ¶
type InitValidater interface {
InitValidate(log log.Logger, store state.SimpleDB, vals []*abci.Validator)
}
InitValidater sets the initial validator set
type NopDeliver ¶
type NopDeliver struct{}
func (NopDeliver) DeliverTx ¶
func (_ NopDeliver) DeliverTx(Context, state.SimpleDB, Tx) (r DeliverResult, e error)
type NopInitState ¶
type NopInitState struct{}
type Tx ¶
type Tx struct {
TxInner "json:\"unwrap\""
}
func (Tx) MarshalJSON ¶
func (*Tx) UnmarshalJSON ¶
type TxInner ¶
type TxInner interface { Wrap() Tx // ValidateBasic should be a stateless check and just verify that the // tx is properly formated (required strings not blank, signatures exist, etc.) // this can also be run on the client-side for better debugging before posting a tx ValidateBasic() error }
TxInner is the interface all concrete transactions should implement.
It adds bindings for clean un/marhsaling of the various implementations both as json and binary, as well as some common functionality to move them.
+gen wrapper:"Tx"
Directories ¶
Path | Synopsis |
---|---|
commands
Package commands contains any general setup/helpers valid for all subcommands
|
Package commands contains any general setup/helpers valid for all subcommands |
nolint
|
nolint |
examples
|
|
modules
|
|
auth
nolint
|
nolint |
base
nolint
|
nolint |
coin
nolint
|
nolint |
fee
nolint
|
nolint |
nonce
nolint
|
nolint |
roles
nolint
|
nolint |
server
|
|
nolint
|
nolint |
nolint
|
nolint |
tests
|
|
nolint
|
nolint |