Documentation ¶
Index ¶
- Variables
- func ValidateBasic(data []byte, signerAddr []Address, signatures []Signature) error
- func ValidateFee(feeOpt *fees.FeeOption, fee Fee) error
- type Address
- type Amount
- type Balance
- type Context
- type Fee
- type Gas
- type Msg
- type MsgData
- type RawTx
- type Response
- type Router
- type Signature
- type SignedTx
- type Tx
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingData = codes.ProtocolError{codes.TxErrMisingData, "missing data in transaction"} ErrUnserializable = codes.ProtocolError{codes.TxErrUnserializable, "unserializable tx"} ErrWrongTxType = codes.ProtocolError{codes.TxErrWrongTxType, "wrong tx type"} ErrInvalidAmount = codes.ProtocolError{codes.TxErrInvalidAmount, "invalid amount"} ErrInvalidPubkey = codes.ProtocolError{codes.TxErrInvalidPubKey, "invalid pubkey"} ErrUnmatchSigner = codes.ProtocolError{codes.TxErrUnmatchedSigner, "unmatch signers"} ErrInvalidSignature = codes.ProtocolError{codes.TxErrInvalidSignature, "invalid signatures"} ErrInvalidFeeCurrency = codes.ProtocolError{codes.TxErrInvalidFeeCurrency, "invalid fees currency"} ErrInvalidFeePrice = codes.ProtocolError{codes.TxErrInvalidFeePrice, "fee price is smaller than minimal fee"} ErrNotEnoughFund = codes.ProtocolError{codes.TxErrInsufficientFunds, "not enough fund"} ErrGasOverflow = codes.ProtocolError{codes.TxErrGasOverflow, "gas used exceed limit"} ErrInvalidExtTx = codes.ProtocolError{codes.TxErrInvalidExtTx, "invalid external tx"} )
Functions ¶
func ValidateBasic ¶ added in v0.10.8
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 ¶
func (a Amount) IsValid(list *balance.CurrencySet) bool
IsValid checks the validity of the currency and the amount string in the account object, which may be received over a network.
type Context ¶
type Context struct { Router Router State *storage.State Header *abci.Header Accounts accounts.Wallet Balances *balance.Store Domains *ons.DomainStore FeePool *fees.Store Currencies *balance.CurrencySet FeeOpt *fees.FeeOption Validators *identity.ValidatorStore BTCTrackers *bitcoin.TrackerStore ETHTrackers *ethereum.TrackerStore Logger *log.Logger JobStore *jobs.JobStore LockScriptStore *bitcoin.LockScriptStore BTCChainType *chaincfg.Params BlockCypherToken string BlockCypherChainType string }
func NewContext ¶
func NewContext(r Router, header *abci.Header, state *storage.State, wallet accounts.Wallet, balances *balance.Store, currencies *balance.CurrencySet, feeOpt *fees.FeeOption, feePool *fees.Store, validators *identity.ValidatorStore, domains *ons.DomainStore, btcTrackers *bitcoin.TrackerStore, ethTrackers *ethereum.TrackerStore, jobStore *jobs.JobStore, btcChainType *chaincfg.Params, lockScriptStore *bitcoin.LockScriptStore, blockCypherToken, blockCypherChainType string, logger *log.Logger) *Context
type RawTx ¶ added in v0.10.8
type Response ¶
type Router ¶
Router interface supplies functionality to add a handler function and Handle a request.
type SignedTx ¶ added in v0.10.8
func (*SignedTx) SignedBytes ¶ added in v0.10.8
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, signedTx SignedTx) (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, tx RawTx) (bool, Response) //deliver tx on the chain by changing the storage values, which should only be committed at Application //commit stage ProcessDeliver(ctx *Context, tx RawTx) (bool, Response) //process the charge of fees ProcessFee(ctx *Context, signedTx SignedTx, start Gas, size Gas) (bool, Response) }
type Type ¶
type Type int
const ( SEND Type = 0x01 //staking related transaction APPLYVALIDATOR Type = 0x11 WITHDRAW Type = 0x12 //ons related transaction DOMAIN_CREATE Type = 0x21 DOMAIN_UPDATE Type = 0x22 DOMAIN_SELL Type = 0x23 DOMAIN_PURCHASE Type = 0x24 DOMAIN_SEND Type = 0x25 BTC_LOCK Type = 0x81 BTC_ADD_SIGNATURE Type = 0x82 BTC_BROADCAST_SUCCESS Type = 0x83 BTC_REPORT_FINALITY_MINT Type = 0x84 BTC_EXT_MINT Type = 0x85 BTC_REDEEM Type = 0x86 BTC_FAILED_BROADCAST_RESET Type = 0x87 //Ethereum Actions ETH_LOCK Type = 0x91 ETH_SIGN Type = 0x92 ETH_FINALITY Type = 0x93 ETH_MINT Type = 0x94 ETH_REPORT_FINALITY_MINT Type = 0x95 ETH_REDEEM Type = 0x96 )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.