Documentation ¶
Index ¶
- Constants
- func GetStateDBTriePool() *trie.NodePool
- func PovCreateAccountStateKey(address types.Address) []byte
- func PovCreateContractLocalStateKey(prefix byte, rawKey []byte) []byte
- func PovCreateContractStateKey(address types.Address) []byte
- func PovCreateGlobalStateKey(prefix byte, rawKey []byte) []byte
- func PovCreateRepStateKey(address types.Address) []byte
- func PovStateKeyToAddress(key []byte) (types.Address, error)
- type PovContractStateDB
- func (csdb *PovContractStateDB) CommitToDB(batch storage.Batch) error
- func (csdb *PovContractStateDB) CommitToTrie() (bool, error)
- func (csdb *PovContractStateDB) GetCurHash() types.Hash
- func (csdb *PovContractStateDB) GetCurTrie() *trie.Trie
- func (csdb *PovContractStateDB) GetPrevHash() types.Hash
- func (csdb *PovContractStateDB) GetPrevTrie() *trie.Trie
- func (csdb *PovContractStateDB) GetValue(key []byte) ([]byte, error)
- func (csdb *PovContractStateDB) NewCurTireIterator(prefix []byte) *trie.Iterator
- func (csdb *PovContractStateDB) NewPrevTireIterator(prefix []byte) *trie.Iterator
- func (csdb *PovContractStateDB) SetValue(key []byte, val []byte) error
- type PovGlobalStateDB
- func (gsdb *PovGlobalStateDB) CommitToDB(batch storage.Batch) error
- func (gsdb *PovGlobalStateDB) CommitToTrie() error
- func (gsdb *PovGlobalStateDB) GetAccountState(address types.Address) (*types.PovAccountState, error)
- func (gsdb *PovGlobalStateDB) GetContractState(address types.Address) (*types.PovContractState, error)
- func (gsdb *PovGlobalStateDB) GetContractValue(address types.Address, key []byte) ([]byte, error)
- func (gsdb *PovGlobalStateDB) GetCurHash() types.Hash
- func (gsdb *PovGlobalStateDB) GetCurTrie() *trie.Trie
- func (gsdb *PovGlobalStateDB) GetPrevHash() types.Hash
- func (gsdb *PovGlobalStateDB) GetPrevTrie() *trie.Trie
- func (gsdb *PovGlobalStateDB) GetRepState(address types.Address) (*types.PovRepState, error)
- func (gsdb *PovGlobalStateDB) GetValue(key []byte) ([]byte, error)
- func (gsdb *PovGlobalStateDB) LookupContractStateDB(address types.Address) (*PovContractStateDB, error)
- func (gsdb *PovGlobalStateDB) NewCurTireIterator(prefix []byte) *trie.Iterator
- func (gsdb *PovGlobalStateDB) NewPrevTireIterator(prefix []byte) *trie.Iterator
- func (gsdb *PovGlobalStateDB) SetAccountState(address types.Address, as *types.PovAccountState) error
- func (gsdb *PovGlobalStateDB) SetContractValue(address types.Address, key []byte, val []byte) error
- func (gsdb *PovGlobalStateDB) SetRepState(address types.Address, rs *types.PovRepState) error
- func (gsdb *PovGlobalStateDB) SetValue(key []byte, val []byte) error
Constants ¶
View Source
const ( PovGlobalStatePrefixAcc = byte(1) PovGlobalStatePrefixRep = byte(2) PovGlobalStatePrefixCS = byte(201) // Contract State PovStatusOffline = 0 PovStatusOnline = 1 )
Variables ¶
This section is empty.
Functions ¶
func GetStateDBTriePool ¶
func PovCreateContractLocalStateKey ¶
PovCreateContractLocalStateKey used for contract trie tree key only prefix MUST be UNIQUE in contract namespace, not in global namespace
func PovCreateGlobalStateKey ¶
PovCreateGlobalStateKey used for global trie key only prefix MUST be UNIQUE in global namespace
func PovCreateRepStateKey ¶
Types ¶
type PovContractStateDB ¶
type PovContractStateDB struct { CS *types.PovContractState // contains filtered or unexported fields }
func NewPovContractStateDB ¶
func NewPovContractStateDB(db storage.Store, cs *types.PovContractState) *PovContractStateDB
func (*PovContractStateDB) CommitToDB ¶
func (csdb *PovContractStateDB) CommitToDB(batch storage.Batch) error
func (*PovContractStateDB) CommitToTrie ¶
func (csdb *PovContractStateDB) CommitToTrie() (bool, error)
func (*PovContractStateDB) GetCurHash ¶
func (csdb *PovContractStateDB) GetCurHash() types.Hash
func (*PovContractStateDB) GetCurTrie ¶
func (csdb *PovContractStateDB) GetCurTrie() *trie.Trie
func (*PovContractStateDB) GetPrevHash ¶
func (csdb *PovContractStateDB) GetPrevHash() types.Hash
func (*PovContractStateDB) GetPrevTrie ¶
func (csdb *PovContractStateDB) GetPrevTrie() *trie.Trie
func (*PovContractStateDB) GetValue ¶
func (csdb *PovContractStateDB) GetValue(key []byte) ([]byte, error)
func (*PovContractStateDB) NewCurTireIterator ¶
func (csdb *PovContractStateDB) NewCurTireIterator(prefix []byte) *trie.Iterator
func (*PovContractStateDB) NewPrevTireIterator ¶
func (csdb *PovContractStateDB) NewPrevTireIterator(prefix []byte) *trie.Iterator
type PovGlobalStateDB ¶
type PovGlobalStateDB struct {
// contains filtered or unexported fields
}
func NewPovGlobalStateDB ¶
func NewPovGlobalStateDB(db storage.Store, prevStateHash types.Hash) *PovGlobalStateDB
func (*PovGlobalStateDB) CommitToDB ¶
func (gsdb *PovGlobalStateDB) CommitToDB(batch storage.Batch) error
func (*PovGlobalStateDB) CommitToTrie ¶
func (gsdb *PovGlobalStateDB) CommitToTrie() error
func (*PovGlobalStateDB) GetAccountState ¶
func (gsdb *PovGlobalStateDB) GetAccountState(address types.Address) (*types.PovAccountState, error)
func (*PovGlobalStateDB) GetContractState ¶
func (gsdb *PovGlobalStateDB) GetContractState(address types.Address) (*types.PovContractState, error)
func (*PovGlobalStateDB) GetContractValue ¶
func (*PovGlobalStateDB) GetCurHash ¶
func (gsdb *PovGlobalStateDB) GetCurHash() types.Hash
func (*PovGlobalStateDB) GetCurTrie ¶
func (gsdb *PovGlobalStateDB) GetCurTrie() *trie.Trie
func (*PovGlobalStateDB) GetPrevHash ¶
func (gsdb *PovGlobalStateDB) GetPrevHash() types.Hash
func (*PovGlobalStateDB) GetPrevTrie ¶
func (gsdb *PovGlobalStateDB) GetPrevTrie() *trie.Trie
func (*PovGlobalStateDB) GetRepState ¶
func (gsdb *PovGlobalStateDB) GetRepState(address types.Address) (*types.PovRepState, error)
func (*PovGlobalStateDB) GetValue ¶
func (gsdb *PovGlobalStateDB) GetValue(key []byte) ([]byte, error)
func (*PovGlobalStateDB) LookupContractStateDB ¶
func (gsdb *PovGlobalStateDB) LookupContractStateDB(address types.Address) (*PovContractStateDB, error)
func (*PovGlobalStateDB) NewCurTireIterator ¶
func (gsdb *PovGlobalStateDB) NewCurTireIterator(prefix []byte) *trie.Iterator
func (*PovGlobalStateDB) NewPrevTireIterator ¶
func (gsdb *PovGlobalStateDB) NewPrevTireIterator(prefix []byte) *trie.Iterator
func (*PovGlobalStateDB) SetAccountState ¶
func (gsdb *PovGlobalStateDB) SetAccountState(address types.Address, as *types.PovAccountState) error
func (*PovGlobalStateDB) SetContractValue ¶
func (*PovGlobalStateDB) SetRepState ¶
func (gsdb *PovGlobalStateDB) SetRepState(address types.Address, rs *types.PovRepState) error
Click to show internal directories.
Click to hide internal directories.