Documentation ¶
Index ¶
- Variables
- func TransToSpecBlock(db fdb.Database, cache Database, from common.Hash, to common.Hash) error
- type Database
- type SnapshotSt
- type StateDB
- func (s *StateDB) AddLog(log *types.Log)
- func (s *StateDB) AddPreimage(hash common.Hash, preimage []byte)
- func (s *StateDB) AddRefund(gas uint64)
- func (s *StateDB) Commit(batch fdb.Batch, blockHash common.Hash, blockNum uint64) (common.Hash, error)
- func (s *StateDB) Copy() *StateDB
- func (s *StateDB) Database() Database
- func (s *StateDB) Delete(account string, key string)
- func (s *StateDB) Error() error
- func (s *StateDB) Finalise()
- func (s *StateDB) Get(account string, key string) ([]byte, error)
- func (s *StateDB) GetLogs(hash common.Hash) []*types.Log
- func (s *StateDB) GetRefund() uint64
- func (s *StateDB) GetSnapshot(account string, key string, time uint64) ([]byte, error)
- func (s *StateDB) GetSnapshotLast() (uint64, error)
- func (s *StateDB) GetSnapshotPrev(time uint64) (uint64, error)
- func (s *StateDB) GetState(account string, key common.Hash) common.Hash
- func (s *StateDB) IntermediateRoot() common.Hash
- func (s *StateDB) Logs() []*types.Log
- func (s *StateDB) LookupAccountInfo() ([]types.AccountInfo, bool)
- func (s *StateDB) Preimages() map[common.Hash][]byte
- func (s *StateDB) Prepare(thash, bhash common.Hash, ti int)
- func (s *StateDB) Put(account string, key string, value []byte)
- func (s *StateDB) ReceiptRoot() common.Hash
- func (s *StateDB) Reset(root common.Hash) error
- func (s *StateDB) RevertToSnapshot(revid int)
- func (s *StateDB) RpcGet(account string, key string) ([]byte, error)
- func (s *StateDB) RpcGetState(account string, key common.Hash) common.Hash
- func (s *StateDB) SetState(account string, key, value common.Hash)
- func (s *StateDB) Snapshot() int
- func (s *StateDB) StartGetAccountInfo(time uint64) error
- func (s *StateDB) StopGetAccountInfo() error
- type Trie
Constants ¶
This section is empty.
Variables ¶
View Source
var MaxTrieCacheGen = uint16(120)
Functions ¶
Types ¶
type Database ¶
type Database interface { GetDB() fdb.Database OpenTrie(root common.Hash) (Trie, error) TrieDB() *trie.Database Lock() UnLock() }
Database cache db exported
func NewDatabase ¶
NewDatabase creates a backing store for state.
type SnapshotSt ¶ added in v0.0.7
type SnapshotSt struct {
// contains filtered or unexported fields
}
func NewSnapshot ¶ added in v0.0.7
func NewSnapshot(db fdb.Database, sptime uint64) *SnapshotSt
func (*SnapshotSt) SnapShotblk ¶ added in v0.0.7
func (sn *SnapshotSt) SnapShotblk()
func (*SnapshotSt) Start ¶ added in v0.0.7
func (sn *SnapshotSt) Start()
func (*SnapshotSt) Stop ¶ added in v0.0.7
func (sn *SnapshotSt) Stop()
type StateDB ¶
type StateDB struct {
// contains filtered or unexported fields
}
StateDB store block operate info
func (*StateDB) AddPreimage ¶
hash is preimageHash
func (*StateDB) Commit ¶
func (s *StateDB) Commit(batch fdb.Batch, blockHash common.Hash, blockNum uint64) (common.Hash, error)
Commit the block state to db. after success please call commitcache batch: batch to db blockHash: the hash of commit block
func (*StateDB) GetSnapshot ¶
func (*StateDB) GetSnapshotLast ¶
func (*StateDB) IntermediateRoot ¶
func (*StateDB) LookupAccountInfo ¶ added in v0.0.7
func (s *StateDB) LookupAccountInfo() ([]types.AccountInfo, bool)
func (*StateDB) ReceiptRoot ¶
ReceiptRoot compute one tx‘ receipt hash
func (*StateDB) RevertToSnapshot ¶
func (*StateDB) RpcGet ¶
RpcGet provide get value of the key to rpc when called please RLock cachedb
func (*StateDB) RpcGetState ¶
RpcGetState provide get value of the key to rpc when called please RLock cachedb
func (*StateDB) StartGetAccountInfo ¶ added in v0.0.7
func (*StateDB) StopGetAccountInfo ¶ added in v0.0.7
type Trie ¶
type Trie interface { TryGet(key []byte) ([]byte, error) TryUpdate(key, value []byte) error TryDelete(key []byte) error Commit(onleaf trie.LeafCallback) (common.Hash, error) Hash() common.Hash NodeIterator(startKey []byte) trie.NodeIterator GetKey([]byte) []byte // TODO(fjl): remove this when SecureTrie is removed Prove(key []byte, fromLevel uint, proofDb fdb.Putter) error }
Click to show internal directories.
Click to hide internal directories.