Documentation ¶
Index ¶
- Constants
- Variables
- 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 Ticker
- type TickerFunc
- type Tx
- type TxInner
- type TxLayer
Constants ¶
const ( // ModuleNameBase is the module name for internal functionality ModuleNameBase = "base" // ChainKey is the option key for setting the chain id ChainKey = "chain_id" )
Variables ¶
var TxMapper = data.NewMapper(Tx{})
Functions ¶
This section is empty.
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 int64 // GasPayment is the total fees for this tx (or other source of payment) GasPayment int64 }
CheckResult captures any non-error abci result to make sure people use error for error cases
func NewCheck ¶
func NewCheck(gasAllocated int64, 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 (c CheckResult) GetData() data.Bytes
func (CheckResult) ToABCI ¶ added in v0.8.0
func (c CheckResult) ToABCI() abci.ResponseCheckTx
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() int64 }
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 ¶
type DeliverResult struct { Data data.Bytes Log string Diff []*abci.Validator Tags []*abci.KVPair GasUsed int64 // unused }
DeliverResult captures any non-error abci result to make sure people use error for error cases
func (DeliverResult) GetData ¶
func (d DeliverResult) GetData() data.Bytes
func (DeliverResult) ToABCI ¶ added in v0.8.0
func (d DeliverResult) ToABCI() abci.ResponseDeliverTx
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 TickerFunc ¶ added in v0.8.0
TickerFunc allows a function to implement the interface
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 |
---|---|
Package app contains data structures that provide basic data storage functionality and act as a bridge between the abci interface and the internal sdk representations.
|
Package app contains data structures that provide basic data storage functionality and act as a bridge between the abci interface and the internal sdk representations. |
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
|
|
Package genesis provides some utility functions for parsing a standard genesis file to initialize your abci application.
|
Package genesis provides some utility functions for parsing a standard genesis file to initialize your abci application. |
modules
|
|
auth
nolint Package auth contains generic Signable implementations that can be used by your application or tests to handle authentication needs.
|
nolint Package auth contains generic Signable implementations that can be used by your application or tests to handle authentication needs. |
base
nolint
|
nolint |
coin
nolint
|
nolint |
fee
nolint
|
nolint |
nonce
nolint Package nonce - This module allows replay protection to be added to process stack.
|
nolint Package nonce - This module allows replay protection to be added to process stack. |
roles
nolint
|
nolint |
server
|
|
nolint nolint
|
nolint nolint |
nolint
|
nolint |
tests
|
|
nolint
|
nolint |