vmctxt_interface

package
v0.0.3-powserver Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractGid

type ContractGid interface {
	Gid() *types.Gid
	Addr() *types.Address
}

type StorageIterator

type StorageIterator interface {
	Next() (key, value []byte, ok bool)
}

type UnsavedCache

type UnsavedCache interface {
	Trie() *trie.Trie
	SetStorage(key []byte, value []byte)
	GetStorage(key []byte) []byte
	ContractGidList() []ContractGid
	LogList() ledger.VmLogList
	Storage() map[string][]byte
}

type VmDatabase

type VmDatabase interface {
	GetBalance(addr *types.Address, tokenTypeId *types.TokenTypeId) *big.Int
	AddBalance(tokenTypeId *types.TokenTypeId, amount *big.Int)
	SubBalance(tokenTypeId *types.TokenTypeId, amount *big.Int)
	GetSnapshotBlockByHeight(height uint64) *ledger.SnapshotBlock
	GetSnapshotBlockByHash(hash *types.Hash) *ledger.SnapshotBlock

	// forward=true return [startHeight, startHeight+count), forward=false return (startHeight-count, startHeight]
	GetSnapshotBlocks(startHeight uint64, count uint64, forward, containSnapshotContent bool) []*ledger.SnapshotBlock

	GetAccountBlockByHash(hash *types.Hash) *ledger.AccountBlock

	UnsavedCache() UnsavedCache
	Reset()

	IsAddressExisted(addr *types.Address) bool

	SetContractGid(gid *types.Gid, addr *types.Address)
	SetContractCode(code []byte)
	GetContractCode(addr *types.Address) []byte

	GetStorage(addr *types.Address, key []byte) []byte
	SetStorage(key []byte, value []byte)
	GetStorageHash() *types.Hash

	AddLog(log *ledger.VmLog)
	GetLogListHash() *types.Hash

	NewStorageIterator(addr *types.Address, prefix []byte) StorageIterator

	CopyAndFreeze() VmDatabase

	GetGid() *types.Gid
	Address() *types.Address
	CurrentSnapshotBlock() *ledger.SnapshotBlock
	PrevAccountBlock() *ledger.AccountBlock
}

Jump to

Keyboard shortcuts

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