Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingData = errors.New("missing data for tx") ErrUnserializable = errors.New("unserializable 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") ErrNotEnoughFund = errors.New("not enough fund") )
Functions ¶
This section is empty.
Types ¶
type Amount ¶
Amount is an easily serializable representation of coin. Nodes can create coin from the Amount object received over the network
func (Amount) IsValid ¶
IsValid checks the validity of the currency and the amount string in the account object, which may be received over a network.
type ApplyValidator ¶ added in v0.10.4
type ApplyValidator struct {
Address Address
Stake Amount
NodeName string
ValidatorAddress Address
ValidatorPubKey keys.PublicKey
Purge bool
}
func (ApplyValidator) Bytes ¶ added in v0.10.4
func (apply ApplyValidator) Bytes() []byte
func (ApplyValidator) Signers ¶ added in v0.10.4
func (apply ApplyValidator) Signers() []Address
func (ApplyValidator) Tags ¶ added in v0.10.4
func (apply ApplyValidator) Tags() common.KVPairs
func (ApplyValidator) Type ¶ added in v0.10.4
func (apply ApplyValidator) Type() Type
type BaseTx ¶
type Context ¶
type Context struct {
Router Router
Accounts accounts.Wallet
Balances *balance.Store
Currencies *balance.CurrencyList
Validators *identity.ValidatorStore
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, memo string, 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.