statedb

package
v1.4.2-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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 GetStateDBTriePool() *trie.NodePool

func PovCreateAccountStateKey

func PovCreateAccountStateKey(address types.Address) []byte

func PovCreateContractLocalStateKey

func PovCreateContractLocalStateKey(prefix byte, rawKey []byte) []byte

PovCreateContractLocalStateKey used for contract trie tree key only prefix MUST be UNIQUE in contract namespace, not in global namespace

func PovCreateContractStateKey

func PovCreateContractStateKey(address types.Address) []byte

func PovCreateGlobalStateKey

func PovCreateGlobalStateKey(prefix byte, rawKey []byte) []byte

PovCreateGlobalStateKey used for global trie key only prefix MUST be UNIQUE in global namespace

func PovCreateRepStateKey

func PovCreateRepStateKey(address types.Address) []byte

func PovStateKeyToAddress

func PovStateKeyToAddress(key []byte) (types.Address, error)

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

func (*PovContractStateDB) SetValue

func (csdb *PovContractStateDB) SetValue(key []byte, val []byte) error

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 (gsdb *PovGlobalStateDB) GetContractValue(address types.Address, key []byte) ([]byte, error)

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 (gsdb *PovGlobalStateDB) SetContractValue(address types.Address, key []byte, val []byte) error

func (*PovGlobalStateDB) SetRepState

func (gsdb *PovGlobalStateDB) SetRepState(address types.Address, rs *types.PovRepState) error

func (*PovGlobalStateDB) SetValue

func (gsdb *PovGlobalStateDB) SetValue(key []byte, val []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL