vmstore

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: MIT, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStorageExists   = errors.New("storage already exists")
	ErrStorageNotFound = errors.New("storage not found")
)

Functions

This section is empty.

Types

type ContractStore

type ContractStore interface {
	GetStorage(prefix, key []byte) ([]byte, error)
	SetStorage(prefix, key []byte, value []byte) error
	Iterator(prefix []byte, fn func(key []byte, value []byte) error) error

	CalculateAmount(block *types.StateBlock) (types.Balance, error)
	IsUserAccount(address types.Address) (bool, error)
	GetAccountMeta(address types.Address) (*types.AccountMeta, error)
	SaveStorage() error
}

type VMCache

type VMCache struct {
	// contains filtered or unexported fields
}

func NewVMCache

func NewVMCache(trie *trie.Trie) *VMCache

func (*VMCache) Clear

func (cache *VMCache) Clear()

func (*VMCache) GetStorage

func (cache *VMCache) GetStorage(key []byte) []byte

func (*VMCache) LogList

func (cache *VMCache) LogList() types.VmLogs

func (*VMCache) SetStorage

func (cache *VMCache) SetStorage(key []byte, value []byte)

func (*VMCache) Storage

func (cache *VMCache) Storage() map[string][]byte

func (*VMCache) Trie

func (cache *VMCache) Trie() *trie.Trie

type VMContext

type VMContext struct {
	Cache *VMCache
	// contains filtered or unexported fields
}

func NewVMContext

func NewVMContext(l *ledger.Ledger) *VMContext

func (*VMContext) CalculateAmount

func (v *VMContext) CalculateAmount(block *types.StateBlock) (types.Balance, error)

func (*VMContext) GetAccountMeta

func (v *VMContext) GetAccountMeta(address types.Address) (*types.AccountMeta, error)

func (*VMContext) GetStorage

func (v *VMContext) GetStorage(prefix, key []byte) ([]byte, error)

func (*VMContext) IsUserAccount

func (v *VMContext) IsUserAccount(address types.Address) (bool, error)

func (*VMContext) Iterator

func (v *VMContext) Iterator(prefix []byte, fn func(key []byte, value []byte) error) error

func (*VMContext) SaveStorage

func (v *VMContext) SaveStorage() error

func (*VMContext) SaveTrie

func (v *VMContext) SaveTrie() error

func (*VMContext) SetStorage

func (v *VMContext) SetStorage(prefix, key []byte, value []byte) error

Jump to

Keyboard shortcuts

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