Documentation ¶
Index ¶
- Variables
- func GetEvent(pairs kv.Pairs, eventType string) []types.Event
- 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 TxTypeDescribe
- 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"} ErrInvalidAddress = codes.ErrBadAddress ErrInvalidCurrency = codes.ProtocolError{codes.TxErrInvalidFeeCurrency, "invalid amount"} ErrTokenNotSupported = codes.ProtocolError{codes.ExternalErrTokenNotSuported, "Token not supported"} )
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 Witnesses *identity.WitnessStore BTCTrackers *bitcoin.TrackerStore ETHTrackers *ethereum.TrackerStore Logger *log.Logger JobStore *jobs.JobStore LockScriptStore *bitcoin.LockScriptStore }
func NewContext ¶
func NewContext(r Router, header *abci.Header, state *storage.State, wallet accounts.Wallet, balances *balance.Store, currencies *balance.CurrencySet, feePool *fees.Store, validators *identity.ValidatorStore, witnesses *identity.WitnessStore, domains *ons.DomainStore, btcTrackers *bitcoin.TrackerStore, ethTrackers *ethereum.TrackerStore, jobStore *jobs.JobStore, lockScriptStore *bitcoin.LockScriptStore, 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 TxTypeDescribe ¶ added in v0.14.0
type Type ¶
type Type int
const ( SEND Type = 0x01 //staking related transaction APPLYVALIDATOR Type = 0x11 WITHDRAW Type = 0x12 PURGE Type = 0x13 //ons related transaction DOMAIN_CREATE Type = 0x21 DOMAIN_UPDATE Type = 0x22 DOMAIN_SELL Type = 0x23 DOMAIN_PURCHASE Type = 0x24 DOMAIN_SEND Type = 0x25 DOMAIN_DELETE_SUB Type = 0x26 DOMAIN_RENEW Type = 0x27 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_REPORT_FINALITY_MINT Type = 0x92 ETH_REDEEM Type = 0x93 ERC20_LOCK Type = 0x94 ERC20_REDEEM Type = 0x95 //Domain Changes block height constant DOMAIN_CHANGE_BLOCK_HEIGHT = 200000 //EOF here Only used as a marker to mark the end of Type list //So that the query for Types can return all Types dynamically //, when there is a change made in Type list //This value should be manually set as the largest among the list EOF Type = 0xFF )
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package for transactions related to Etheruem Package for transactions related to Etheruem Package for transactions related to Etheruem Package for transactions related to Etheruem Package for transactions related to Etheruem Package for transactions related to Etheruem
|
Package for transactions related to Etheruem Package for transactions related to Etheruem Package for transactions related to Etheruem Package for transactions related to Etheruem Package for transactions related to Etheruem Package for transactions related to Etheruem |
Click to show internal directories.
Click to hide internal directories.