Versions in this module Expand all Collapse all v1 v1.3.0 Jun 14, 2019 Changes in this version + const MaxDeputyHostLength + const MaxSignersNumber + const SignerWeightThreshold + const StandardNodeIdLength + var ErrAddressRepeat = errors.New("cannot set two identical addresses") + var ErrAddressType = errors.New("address type wrong") + var ErrAgainRegister = errors.New("cannot register again after unregistering") + var ErrApplyBoxTxsTimeout = errors.New("apply box txs timeout") + var ErrAssetCategory = errors.New("assert's Category not exist") + var ErrAssetIssuer = errors.New("issue asset transaction's sender must the asset issuer") + var ErrFrozenAsset = errors.New("can't replenish the frozen assets") + var ErrGasPayer = errors.New("the gasPayer error") + var ErrInsufficientBalance = errors.New("insufficient balance for transfer") + var ErrInsufficientBalanceForGas = errors.New("insufficient balance to pay for gas") + var ErrInvalidAddress = errors.New("invalid address") + var ErrInvalidGenesis = errors.New("can't process genesis block") + var ErrInvalidHost = errors.New("the length of host field in transaction is out of max length limit") + var ErrInvalidNodeId = errors.New("invalid nodeId") + var ErrInvalidTxInBlock = errors.New("block contains invalid transaction") + var ErrIsDivisible = errors.New("this \"isDivisible == false\" kind of asset can't be replenished") + var ErrIsReplenishable = errors.New("asset's \"IsReplenishable\" is false") + var ErrIssueAssetAmount = errors.New("issue asset amount can't be 0 or nil") + var ErrIssueAssetMetaData = errors.New("the length of metaData more than limit") + var ErrMarshalAssetLength = errors.New("the length of data by marshal asset more than max length") + var ErrModifyAssetInfo = errors.New("missing required field 'info' for ModifyAssetInfo") + var ErrModifyAssetTxSender = errors.New("the sender does not have permission to modify this asset") + var ErrNestedBoxTx = errors.New("box transaction cannot be a sub transaction") + var ErrNotEqualAssetCode = errors.New("assetCode not equal") + var ErrOfAgainVote = errors.New("already voted the same as candidate node") + var ErrOfNotCandidateNode = errors.New("node address is not candidate account") + var ErrOfRegisterHost = errors.New("can't get host of RegisterInfo") + var ErrOfRegisterNodeID = errors.New("can't get nodeId of RegisterInfo") + var ErrOfRegisterPort = errors.New("can't get port of RegisterInfo") + var ErrRepeatSetTempAddress = errors.New("the temp address's multisig has been set up") + var ErrReplenishAssetAmount = errors.New("replenish asset amount can't be 0 or nil") + var ErrSetMulisig = errors.New("from and to must be equal") + var ErrSignerAndFromUnequally = errors.New("the signer and from of transaction are not equal") + var ErrSignersNumber = errors.New("cannot exceed the maximum number of signers") + var ErrTempAccount = errors.New("temp account format error") + var ErrTempAddress = errors.New("the issuer part in temp address is incorrect") + var ErrTotalWeight = errors.New("insufficient total weight of signatories") + var ErrTxNotSign = errors.New("the transaction is not signed") + var ErrWeight = errors.New("signer weight error") + func CanTransfer(am vm.AccountManager, addr common.Address, amount *big.Int) bool + func GetHashFn(ref *types.Header, chain BlockLoader) vm.GetHashFunc + func IntrinsicGas(txType uint16, data []byte, txMessage string) (uint64, error) + func NewEVMContext(tx *types.Transaction, header *types.Header, txIndex uint, ...) vm.Context + func Transfer(am vm.AccountManager, sender, recipient common.Address, amount *big.Int) + type BlockLoader interface + GetBlockByHash func(hash common.Hash) *types.Block + GetParentByHeight func(height uint32, sonBlockHash common.Hash) *types.Block + type BoxTxEnv struct + func NewBoxTxEnv(p *TxProcessor) *BoxTxEnv + func (b *BoxTxEnv) RunBoxTxs(gp *types.GasPool, boxTx *types.Transaction, header *types.Header, ...) (uint64, error) + type CandidateVoteEnv struct + CanTransfer func(vm.AccountManager, common.Address, *big.Int) bool + Transfer func(vm.AccountManager, common.Address, common.Address, *big.Int) + func NewCandidateVoteEnv(am *account.Manager) *CandidateVoteEnv + func (c *CandidateVoteEnv) CallVoteTx(voter, node common.Address, initialBalance *big.Int) error + func (c *CandidateVoteEnv) RegisterOrUpdateToCandidate(tx *types.Transaction, initialSenderBalance *big.Int) error + type ModifySigners struct + Signers types.Signers + type RunAssetEnv struct + func NewRunAssetEnv(am *account.Manager) *RunAssetEnv + func (r *RunAssetEnv) CreateAssetTx(sender common.Address, data []byte, txHash common.Hash) error + func (r *RunAssetEnv) IssueAssetTx(sender, receiver common.Address, txHash common.Hash, data []byte) error + func (r *RunAssetEnv) ModifyAssetProfileTx(sender common.Address, data []byte) error + func (r *RunAssetEnv) ReplenishAssetTx(sender, receiver common.Address, data []byte) error + type SetMultisigAccountEnv struct + func NewSetMultisigAccountEnv(am *account.Manager) *SetMultisigAccountEnv + func (s *SetMultisigAccountEnv) ModifyMultisigTx(from, to common.Address, data []byte) error + type TxProcessor struct + ChainID uint16 + func NewTxProcessor(issueRewardAddress common.Address, chainID uint16, blockLoader BlockLoader, ...) *TxProcessor + func (p *TxProcessor) ApplyTxs(header *types.Header, txs types.Transactions, timeLimitSecond int64) (types.Transactions, types.Transactions, uint64) + func (p *TxProcessor) PreExecutionTransaction(ctx context.Context, accM *account.ReadOnlyManager, header *types.Header, ...) ([]byte, uint64, error) + func (p *TxProcessor) Process(header *types.Header, txs types.Transactions) (uint64, error)