Documentation ¶
Index ¶
- Variables
- func TransToSpecBlock(db fdb.Database, cache Database, from common.Hash, to common.Hash) error
- type Database
- 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) GetState(account string, key common.Hash) common.Hash
- func (s *StateDB) IntermediateRoot() common.Hash
- func (s *StateDB) Logs() []*types.Log
- 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
- 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 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) IntermediateRoot ¶
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
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.