Documentation ¶
Index ¶
- 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) CommitCache(blockHash common.Hash)
- 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() 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
type Database interface { Get(key string) ([]byte, error) Put(key string, value []byte) error Delete(key string) error PutCache(key string, value []byte) error DeleteCache(key string) error GetDB() fdb.Database GetHash() common.Hash SetHash(hash common.Hash) Lock() UnLock() RLock() RUnLock() Purge() }
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) CommitCache ¶
CommitCache commit the block state to cache call after state commit to db success
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
Click to show internal directories.
Click to hide internal directories.