storage

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyToStr

func KeyToStr(key states.IStateKeyInterface) string

Types

type CloneCache

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

func NewCloneDBCache

func NewCloneDBCache(innerCache DBCache, dbCache DBCache) *CloneCache

func (*CloneCache) Commit

func (cloneCache *CloneCache) Commit()

func (*CloneCache) GetInnerCache

func (cloneCache *CloneCache) GetInnerCache() DBCache

func (*CloneCache) TryGet

func (cloneCache *CloneCache) TryGet(prefix store.DataEntryPrefix, key string) (states.IStateValueInterface, error)

type DBCache

type DBCache interface {
	GetOrAdd(prefix store.DataEntryPrefix, key string, value states.IStateValueInterface) (states.IStateValueInterface, error)
	TryGet(prefix store.DataEntryPrefix, key string) (states.IStateValueInterface, error)
	GetWriteSet() *RWSet
	GetState(codeHash common.Uint160, loc common.Hash) (common.Hash, error)
	SetState(codeHash common.Uint160, loc, value common.Hash)
	GetCode(codeHash common.Uint160) ([]byte, error)
	SetCode(codeHash common.Uint160, code []byte)
	GetBalance(common.Uint160) *big.Int
	GetCodeSize(common.Uint160) int
	AddBalance(common.Uint160, *big.Int)
	Suicide(codeHash common.Uint160) bool
}

type RWSet

type RWSet struct {
	ReadSet  map[string]*Read
	WriteSet map[string]*Write
}

func NewRWSet

func NewRWSet() *RWSet

func (*RWSet) Add

func (rw *RWSet) Add(prefix store.DataEntryPrefix, key string, value states.IStateValueInterface)

func (*RWSet) Delete

func (rw *RWSet) Delete(key string)

type Read

type Read struct {
	Key     states.IStateKeyInterface
	Version string
}

type Write

type Write struct {
	Prefix    store.DataEntryPrefix
	Key       string
	Item      states.IStateValueInterface
	IsDeleted bool
}

Jump to

Keyboard shortcuts

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