Versions in this module Expand all Collapse all v1 v1.0.3 Apr 3, 2019 Changes in this version + var ErrSyncNode = errors.New("no enough stake value to sync node") + var MaxTrieCacheGen = uint16(120) + func CheckCodeEmpty(codeHash []byte) bool + func NewStateSync(root common.Hash, database trie.DatabaseReader) *trie.TrieSync + func Rank(candidateInfos CandidateInfos) ([]common.Address, []uint64) + func RankWithLenth(candidateInfos CandidateInfos, lenth int, committeeMinStake uint64) ([]common.Address, []uint64) + type Account struct + Balance *big.Int + CodeHash []byte + Nonce uint64 + Root common.Hash + type CandidateInfo struct + Heft uint64 + Point uint64 + Signer common.Address + Stake uint64 + type CandidateInfos []CandidateInfo + func (c CandidateInfos) Apply() + func (c CandidateInfos) Len() int + func (c CandidateInfos) Less(i, j int) bool + func (c CandidateInfos) Swap(i, j int) + type Candidates []common.Address + func (self *Candidates) DelCandidate(addr common.Address) + type Code []byte + func (self Code) String() string + type Database interface + ContractCode func(addrHash, codeHash common.Hash) ([]byte, error) + ContractCodeSize func(addrHash, codeHash common.Hash) (int, error) + CopyTrie func(Trie) Trie + OpenStorageTrie func(addrHash, root common.Hash) (Trie, error) + OpenTrie func(root common.Hash) (Trie, error) + TrieDB func() *trie.Database + func NewDatabase(db ethdb.Database) Database + type Dump struct + Accounts map[string]DumpAccount + Root string + type DumpAccount struct + Balance string + Code string + CodeHash string + Nonce uint64 + Root string + Storage map[string]string + type FilePropertie struct + Ssize uint64 + StorageGas uint64 + StorageGasPrice uint64 + StorageGasUsed uint64 + type ManagedState struct + func ManageState(statedb *StateDB) *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 *StateDB) + type NodeIterator struct + Error error + Hash common.Hash + Parent common.Hash + func NewNodeIterator(state *StateDB) *NodeIterator + func (it *NodeIterator) Next() bool + type StateDB struct + func New(root common.Hash, db Database) (*StateDB, error) + func (db *StateDB) ForEachStorage(addr common.Address, cb func(key, value common.Hash) bool) + func (s *StateDB) Commit(deleteEmptyObjects bool) (root common.Hash, err error) + func (s *StateDB) DeleteSuicides() + func (s *StateDB) Finalise(deleteEmptyObjects bool) + func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash + func (self *StateDB) AddAccountInForbidBackStakeList(address common.Address) bool + func (self *StateDB) AddAlreadyBackStack(backStack common.AlreadyBackStake) bool + func (self *StateDB) AddBalance(addr common.Address, amount *big.Int) + func (self *StateDB) AddCandidate(candidate common.Address) bool + func (self *StateDB) AddLastRootState(statehash common.Hash, blockNumber uint64) bool + func (self *StateDB) AddLog(log *types.Log) + func (self *StateDB) AddPreimage(hash common.Hash, preimage []byte) + func (self *StateDB) AddPromissoryNote(address common.Address, promissoryNote types.PromissoryNote) bool + func (self *StateDB) AddRefund(gas uint64) + func (self *StateDB) AddTxInOptionTxTable(hash common.Hash, promissoryNotesOptionTx types.PromissoryNotesOptionTx, ...) bool + func (self *StateDB) BackStake(id common.Address, blockNumber uint64) (bool, uint64) + func (self *StateDB) BuyPromissoryNotes(orderId common.Hash, address common.Address, optionTxMemorySize uint64) types.PromissoryNotesOptionTx + func (self *StateDB) CarriedOutPromissoryNotes(orderId common.Hash, address common.Address, optionTxMemorySize uint64) types.PromissoryNotesOptionTx + func (self *StateDB) CheckUnlockSharedKey(address common.Address, shareKeyId string) bool + func (self *StateDB) Copy() *StateDB + func (self *StateDB) CreateAccount(addr common.Address) + func (self *StateDB) Database() Database + func (self *StateDB) DelAccountInForbidBackStakeList(address common.Address) bool + func (self *StateDB) DelCandidate(candidate common.Address) bool + func (self *StateDB) DelMainAccountBinding(mianAccount common.Address) []common.Address + func (self *StateDB) DelPromissoryNote(address common.Address, promissoryNote types.PromissoryNote) bool + func (self *StateDB) DelSubAccountBinding(subAccount common.Address) bool + func (self *StateDB) DelTxInOptionTxTable(hash common.Hash, optionTxMemorySize uint64) bool + func (self *StateDB) DeleteStake(id common.Address, stake uint64, blockNumber uint64) (bool, uint64) + func (self *StateDB) Dump() []byte + func (self *StateDB) Empty(addr common.Address) bool + func (self *StateDB) Error() error + func (self *StateDB) Exist(addr common.Address) bool + func (self *StateDB) GetAccountAttributes(addr common.Address) types.GenaroData + func (self *StateDB) GetAccountData(address common.Address) *Account + func (self *StateDB) GetAddressByNode(s string) string + func (self *StateDB) GetAllPromissoryNotesNum(address common.Address) uint64 + func (self *StateDB) GetAlreadyBackStakeList() (bool, common.BackStakeList) + func (self *StateDB) GetBalance(addr common.Address) *big.Int + func (self *StateDB) GetBeforPromissoryNotesNum(address common.Address, blockNumber uint64) uint64 + func (self *StateDB) GetBucketApplyPrice() *big.Int + func (self *StateDB) GetBuckets(addr common.Address) (map[string]interface{}, error) + func (self *StateDB) GetCandidateInfoWithAllSubAccounts(candidate common.Address) (candidateInfo CandidateInfo) + func (self *StateDB) GetCandidates() Candidates + func (self *StateDB) GetCandidatesInfoInRange(blockNumStart uint64, blockNumEnd uint64) []CandidateInfo + func (self *StateDB) GetCandidatesInfoWithAllSubAccounts() []CandidateInfo + func (self *StateDB) GetCode(addr common.Address) []byte + func (self *StateDB) GetCodeHash(addr common.Address) common.Hash + func (self *StateDB) GetCodeSize(addr common.Address) int + func (self *StateDB) GetCommitteeRank(blockNumStart uint64, blockNumEnd uint64) ([]common.Address, []uint64) + func (self *StateDB) GetFileSharePublicKey(addr common.Address) string + func (self *StateDB) GetForbidBackStakeList() types.ForbidBackStakeList + func (self *StateDB) GetGenaroCodeHash(addr common.Address) string + func (self *StateDB) GetGenaroPrice() *types.GenaroPrice + func (self *StateDB) GetHeft(id common.Address) (uint64, error) + func (self *StateDB) GetHeftLastDiff(id common.Address, lastBlockNum uint64) uint64 + func (self *StateDB) GetHeftLog(id common.Address) types.NumLogs + func (self *StateDB) GetHeftRangeDiff(id common.Address, blockNumStart uint64, blockNumEnd uint64) uint64 + func (self *StateDB) GetLastSynState() *types.LastSynState + func (self *StateDB) GetLogs(hash common.Hash) []*types.Log + func (self *StateDB) GetMainAccount(subAccount common.Address) *common.Address + func (self *StateDB) GetMainAccountRank() ([]common.Address, []uint64) + func (self *StateDB) GetMainAccounts() map[common.Address][]common.Address + func (self *StateDB) GetNameAccount(name string) (addr common.Address, err error) + func (self *StateDB) GetNonce(addr common.Address) uint64 + func (self *StateDB) GetOneDayGesCost() *big.Int + func (self *StateDB) GetOneDaySyncLogGsaCost() *big.Int + func (self *StateDB) GetOptionTxTable(hash common.Hash, optionTxMemorySize uint64) *types.OptionTxTable + func (self *StateDB) GetOptionTxTableByAddress(address common.Address) *types.OptionTxTable + func (self *StateDB) GetOrNewStateObject(addr common.Address) *stateObject + func (self *StateDB) GetPromissoryNotes(address common.Address) types.PromissoryNotes + func (self *StateDB) GetRefund() uint64 + func (self *StateDB) GetRewardsValues() *types.RewardsValues + func (self *StateDB) GetSharedFile(address common.Address, shareKeyId string) types.SynchronizeShareKey + func (self *StateDB) GetStake(id common.Address) (uint64, error) + func (self *StateDB) GetStakeLog(id common.Address) types.NumLogs + func (self *StateDB) GetStakePerNodePrice() *big.Int + func (self *StateDB) GetStakeRangeDiff(id common.Address, blockNumStart uint64, blockNumEnd uint64) uint64 + func (self *StateDB) GetState(a common.Address, b common.Hash) common.Hash + func (self *StateDB) GetStorageGas(userid common.Address, bucketID [32]byte) (uint64, error) + func (self *StateDB) GetStorageGasPrice(userid common.Address, bucketID [32]byte) (uint64, error) + func (self *StateDB) GetStorageGasUsed(userid common.Address, bucketID [32]byte) (uint64, error) + func (self *StateDB) GetStorageNodes(addr common.Address) []string + func (self *StateDB) GetStorageSize(userid common.Address, bucketID [32]byte) (uint64, error) + func (self *StateDB) GetSubAccounts(mianAccount common.Address) []common.Address + func (self *StateDB) GetSubAccountsCount(mainAccount common.Address) int + func (self *StateDB) GetTraffic(addr common.Address) uint64 + func (self *StateDB) GetTrafficApplyPrice() *big.Int + func (self *StateDB) HasName(addr common.Address, name string) bool + func (self *StateDB) HasSuicided(addr common.Address) bool + func (self *StateDB) IsAccountExistInForbidBackStakeList(address common.Address) bool + func (self *StateDB) IsAlreadyBackStake(addr common.Address) bool + func (self *StateDB) IsBindingAccount(account common.Address) bool + func (self *StateDB) IsBindingMainAccount(account common.Address) bool + func (self *StateDB) IsBindingSubAccount(account common.Address) bool + func (self *StateDB) IsCandidateExist(candidate common.Address) bool + func (self *StateDB) IsContract(addr common.Address) bool + func (self *StateDB) IsNameAccountExist(name string) (bool, error) + func (self *StateDB) Logs() []*types.Log + func (self *StateDB) MarkStateObjectDirty(addr common.Address) + func (self *StateDB) Preimages() map[common.Hash][]byte + func (self *StateDB) Prepare(thash, bhash common.Hash, ti int) + func (self *StateDB) PromissoryNotesWithdrawCash(address common.Address, blockNumber uint64) uint64 + func (self *StateDB) RawDump() Dump + func (self *StateDB) Reset(root common.Hash) error + func (self *StateDB) RevertToSnapshot(revid int) + func (self *StateDB) SetAlreadyBackStakeList(backStacks common.BackStakeList) bool + func (self *StateDB) SetBalance(addr common.Address, amount *big.Int) + func (self *StateDB) SetCode(addr common.Address, code []byte) + func (self *StateDB) SetCodeHash(addr common.Address, codeHash []byte) + func (self *StateDB) SetGenaroPrice(genaroPrice types.GenaroPrice) bool + func (self *StateDB) SetLastSynBlock(blockNumber uint64, blockHash common.Hash) bool + func (self *StateDB) SetNameAccount(name string, addr common.Address) (err error) + func (self *StateDB) SetNonce(addr common.Address, nonce uint64) + func (self *StateDB) SetRewardsValues(rewardsValues types.RewardsValues) bool + func (self *StateDB) SetState(addr common.Address, key common.Hash, value common.Hash) + func (self *StateDB) SetTxStatusInOptionTxTable(hash common.Hash, status bool, optionTxMemorySize uint64) bool + func (self *StateDB) Snapshot() int + func (self *StateDB) SpecialTxTypeMortgageInit(address common.Address, ...) bool + func (self *StateDB) SpecialTxTypeSyncSidechainStatus(address common.Address, ...) (map[common.Address]*big.Int, bool) + func (self *StateDB) StorageTrie(a common.Address) Trie + func (self *StateDB) SubBalance(addr common.Address, amount *big.Int) + func (self *StateDB) Suicide(addr common.Address) bool + func (self *StateDB) SyncNode2Address(node2UserAccountIndexAddress common.Address, s string, userAddress string) error + func (self *StateDB) SyncStakeNode(address common.Address, s string) error + func (self *StateDB) SynchronizeShareKey(address common.Address, synchronizeShareKey types.SynchronizeShareKey) bool + func (self *StateDB) TurnBuyPromissoryNotes(orderId common.Hash, optionPrice *hexutil.Big, address common.Address, ...) bool + func (self *StateDB) TxLogByDataVersionRead(address common.Address, fileID [32]byte, dataVersion string) (map[common.Address]*hexutil.Big, error) + func (self *StateDB) TxLogBydataVersionUpdate(address common.Address, fileID [32]byte, OfficialAddress common.Address) bool + func (self *StateDB) UbindNode2Address(address common.Address, nodeId string) error + func (self *StateDB) UnbindNode(address common.Address, nodeId string) error + func (self *StateDB) UnlockSharedKey(address common.Address, shareKeyId string) bool + func (self *StateDB) UpdateAccountBinding(mainAccount common.Address, subAccount common.Address) bool + func (self *StateDB) UpdateBucket(addr common.Address, bucket types.BucketPropertie) bool + func (self *StateDB) UpdateBucketApplyPrice(address common.Address, price *hexutil.Big) bool + func (self *StateDB) UpdateBucketProperties(userid common.Address, bucketid string, size uint64, backup uint64, ...) bool + func (self *StateDB) UpdateFileSharePublicKey(id common.Address, publicKey string) bool + func (self *StateDB) UpdateHeft(id common.Address, heft uint64, blockNumber uint64) bool + func (self *StateDB) UpdateOneDayGesCost(address common.Address, price *hexutil.Big) bool + func (self *StateDB) UpdateOneDaySyncLogGsaCost(address common.Address, price *hexutil.Big) bool + func (self *StateDB) UpdateStake(id common.Address, stake uint64, blockNumber uint64) bool + func (self *StateDB) UpdateStakePerNodePrice(address common.Address, price *hexutil.Big) bool + func (self *StateDB) UpdateTraffic(id common.Address, traffic uint64) bool + func (self *StateDB) UpdateTrafficApplyPrice(address common.Address, price *hexutil.Big) bool + type Storage map[common.Hash]common.Hash + func (self Storage) Copy() Storage + func (self Storage) String() (str string) + type Trie 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