Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingData = errors.New("missing data for send tx") ErrWrongTxType = errors.New("wrong tx type") ErrInvalidAmount = errors.New("invalid amount") ErrInvalidPubkey = errors.New("invalid pubkey") ErrUnmatchSigner = errors.New("unmatch signers") ErrInvalidSignature = errors.New("invalid signatures") ErrInvalidFee = errors.New("invalid fees") )
Functions ¶
This section is empty.
Types ¶
type BaseTx ¶
type Context ¶
type Context struct {
Router Router
Accounts accounts.Wallet
Balances *balance.Store
Currencies *balance.CurrencyList
Logger *log.Logger
}
func NewContext ¶
type Router ¶
Router interface supplies functionality to add a handler function and Handle a request.
type Tx ¶
type Tx interface {
//it should be able to validate a tx by itself, non-valid tx will be reject by the node directly
//without going to node process
Validate(ctx *Context, msg Msg, fee Fee, signatures []Signature) (bool, error)
//check tx on the first node who receives it, if process check failed, the tx will not be broadcast
//could store a version of checked value in storage, but not implemented now
ProcessCheck(ctx *Context, msg Msg, fee Fee) (bool, Response)
//deliver tx on the chain by changing the storage values, which should only be committed at Application
//commit stage
ProcessDeliver(ctx *Context, msg Msg, fee Fee) (bool, Response)
//process the charge of fees
ProcessFee(ctx *Context, fee Fee) (bool, Response)
}
Click to show internal directories.
Click to hide internal directories.