Versions in this module Expand all Collapse all v1 v1.0.0 Apr 12, 2019 Changes in this version + const BalanceChange + const CommitNumChange + const DataRootChange + const DeleteAccountChange + const HashLockChange + const LastElectChange + const NewAccountChange + const NonceChange + const PerformanceChange + const StakeChange + const TimeLockChange + const VerifyNumChange + var MaxTrieCacheGen = uint16(120) + var NotEnoughBalanceError = errors.New("not enough balance error") + var NotEnoughStakeErr = errors.New("target account stake not enough") + var ReceiverNotExistErr = errors.New("receiver account does not exist") + var SendCancelTxFirst = errors.New("target need to send cancel transaction first") + var SendRegisterTxFirst = errors.New("target need to send register transaction first") + var SenderNotExistErr = errors.New("sender account does not exist") + var SenderOrReceiverIsEmptyErr = errors.New("sender or receiver is empty") + var TransactionTypeError = errors.New("transaction type miss match with processor function") + func GetBalanceKey(address common.Address) []byte + func GetCommitNumKey(address common.Address) []byte + func GetContractAddrAndKey(key []byte) (common.Address, []byte) + func GetContractFieldKey(address common.Address, key string) []byte + func GetContractRootKey(address common.Address) []byte + func GetDataRootKey(address common.Address) []byte + func GetHashLockKey(address common.Address) []byte + func GetLastElectKey(address common.Address) []byte + func GetNonceKey(address common.Address) []byte + func GetPerformanceKey(address common.Address) []byte + func GetStakeKey(address common.Address) []byte + func GetTimeLockKey(address common.Address) []byte + func GetVerifyNumKey(address common.Address) []byte + type AccountStateDB struct + func NewAccountStateDB(preStateRoot common.Hash, db StateStorage) (*AccountStateDB, error) + func (state *AccountStateDB) AddBalance(addr common.Address, amount *big.Int) error + func (state *AccountStateDB) AddNonce(addr common.Address, amount uint64) error + func (state *AccountStateDB) AddStake(addr common.Address, amount *big.Int) error + func (state *AccountStateDB) Commit() (common.Hash, error) + func (state *AccountStateDB) ContractExist(addr common.Address) bool + func (state *AccountStateDB) Copy() *AccountStateDB + func (state *AccountStateDB) DeleteAccountState(addr common.Address) error + func (state *AccountStateDB) Finalise() (result common.Hash, err error) + func (state *AccountStateDB) GetAccountState(addr common.Address) (*account, error) + func (state *AccountStateDB) GetBalance(addr common.Address) (*big.Int, error) + func (state *AccountStateDB) GetCommitNum(addr common.Address) (uint64, error) + func (state *AccountStateDB) GetContract(addr common.Address, vType reflect.Type) (v reflect.Value, err error) + func (state *AccountStateDB) GetDataRoot(addr common.Address) (common.Hash, error) + func (state *AccountStateDB) GetHashLock(addr common.Address) (common.Hash, error) + func (state *AccountStateDB) GetLastElect(addr common.Address) (uint64, error) + func (state *AccountStateDB) GetNonce(addr common.Address) (uint64, error) + func (state *AccountStateDB) GetPerformance(addr common.Address) (uint64, error) + func (state *AccountStateDB) GetStake(addr common.Address) (*big.Int, error) + func (state *AccountStateDB) GetTimeLock(addr common.Address) (*big.Int, error) + func (state *AccountStateDB) GetVerifyNum(addr common.Address) (uint64, error) + func (state *AccountStateDB) IsEmptyAccount(addr common.Address) bool + func (state *AccountStateDB) MoveStakeToAddress(fromAdd common.Address, toAdd common.Address) error + func (state *AccountStateDB) NewAccountState(addr common.Address) error + func (state *AccountStateDB) PreStateRoot() common.Hash + func (state *AccountStateDB) ProcessPerformance(address common.Address, amount float64) error + func (state *AccountStateDB) ProcessTx(tx model.AbstractTransaction, height uint64) (err error) + func (state *AccountStateDB) ProcessVerification(v model.AbstractVerification, index int) error + func (state *AccountStateDB) ProcessVerifierNumber(address common.Address) error + func (state *AccountStateDB) PutContract(addr common.Address, v reflect.Value) error + func (state *AccountStateDB) RevertToSnapshot(revid int) + func (state *AccountStateDB) SetBalance(addr common.Address, amount *big.Int) error + func (state *AccountStateDB) SetCommitNum(addr common.Address, amount uint64) error + func (state *AccountStateDB) SetDataRoot(addr common.Address, dataRoot common.Hash) error + func (state *AccountStateDB) SetHashLock(addr common.Address, hashLock common.Hash) error + func (state *AccountStateDB) SetLastElect(addr common.Address, blockID uint64) error + func (state *AccountStateDB) SetNonce(addr common.Address, amount uint64) error + func (state *AccountStateDB) SetPerformance(addr common.Address, amount uint64) error + func (state *AccountStateDB) SetStake(addr common.Address, amount *big.Int) error + func (state *AccountStateDB) SetTimeLock(addr common.Address, timeLock *big.Int) error + func (state *AccountStateDB) SetVerifyNum(addr common.Address, amount uint64) error + func (state *AccountStateDB) Snapshot() int + func (state *AccountStateDB) Stake(addr common.Address, amount *big.Int) error + func (state *AccountStateDB) SubBalance(addr common.Address, amount *big.Int) error + func (state *AccountStateDB) SubStake(addr common.Address, amount *big.Int) error + func (state *AccountStateDB) UnStake(addr common.Address) error + type AccountStateProcessor interface + Commit func() (root common.Hash, err error) + ContractExist func(addr common.Address) bool + Finalise func() (root common.Hash, err error) + GetBalance func(addr common.Address) (*big.Int, error) + GetContract func(addr common.Address, vType reflect.Type) (v reflect.Value, err error) + NewAccountState func(addr common.Address) (err error) + PutContract func(addr common.Address, v reflect.Value) error + SetBalance func(addr common.Address, amount *big.Int) error + func MakeGenesisAccountStateProcessor(accountStorage StateStorage) (AccountStateProcessor, error) + type AccountStateReader interface + GetBalance func(addr common.Address) (*big.Int, error) + GetCommitNum func(addr common.Address) (uint64, error) + GetContractRoot func(addr common.Address) (common.Hash, error) + GetLastElect func(addr common.Address) (uint64, error) + GetNonce func(addr common.Address) (uint64, error) + GetProduceNum func(addr common.Address) (uint64, error) + GetStake func(addr common.Address) (*big.Int, error) + GetVerifyNum func(addr common.Address) (uint64, error) + type ManagedState struct + func ManageState(statedb *AccountStateDB) *ManagedState + func (ms *ManagedState) GetNonce(addr common.Address) uint64 + func (ms *ManagedState) HasAccount(addr common.Address) bool + func (ms *ManagedState) NewNonce(addr common.Address) uint64 + func (ms *ManagedState) RemoveNonce(addr common.Address, n uint64) + func (ms *ManagedState) SetNonce(addr common.Address, nonce uint64) + func (ms *ManagedState) SetState(statedb *AccountStateDB) + type NodeList []rlp.RawValue + func (n *NodeList) Put(key []byte, value []byte) error + func (n NodeList) DataSize() int + func (n NodeList) NodeSet() *NodeSet + func (n NodeList) Store(db ethdb.Putter) + type NodeSet struct + func NewNodeSet() *NodeSet + func (db *NodeSet) DataSize() int + func (db *NodeSet) Get(key []byte) ([]byte, error) + func (db *NodeSet) Has(key []byte) (bool, error) + func (db *NodeSet) KeyCount() int + func (db *NodeSet) NodeList() NodeList + func (db *NodeSet) Put(key []byte, value []byte) error + func (db *NodeSet) Store(target ethdb.Putter) + type StateChange interface + type StateChangeList struct + func (scl *StateChangeList) DecodeRLP(s *rlp.Stream) (err error) + func (scl *StateChangeList) EncodeRLP(w io.Writer) error + func (scl *StateChangeList) Len() int + func (scl *StateChangeList) Less(i, j int) bool + func (scl *StateChangeList) Swap(i, j int) + type StateChangeRLP struct + StateChange []byte + StateType uint64 + type StateStorage interface + CopyTrie func(StateTrie) StateTrie + DiskDB func() ethdb.Database + OpenStorageTrie func(addrHash, root common.Hash) (StateTrie, error) + OpenTrie func(root common.Hash) (StateTrie, error) + TrieDB func() *trie.Database + func NewStateStorageWithCache(db ethdb.Database) StateStorage + type StateTrie interface + Commit func(onleaf trie.LeafCallback) (common.Hash, error) + GetKey func([]byte) []byte + Hash func() common.Hash + NodeIterator func(startKey []byte) trie.NodeIterator + Prove func(key []byte, fromLevel uint, proofDb ethdb.Putter) error + TryDelete func(key []byte) error + TryGet func(key []byte) ([]byte, error) + TryUpdate func(key, value []byte) error