storage

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IExternalStorage

type IExternalStorage interface {
	GetBlockHash(block *evmInt256.Int) (*evmInt256.Int, error)

	GetAccount(address types.Address) (*environment.Account, error)
	AccountExist(address types.Address) bool
	AccountEmpty(address types.Address) bool

	HashOfCode(code []byte) types.Hash
	CreateAddress(caller types.Address, tx environment.Transaction) types.Address
	CreateFixedAddress(caller types.Address, salt types.Hash, code []byte, tx environment.Transaction) types.Address

	Load(address types.Address, slot types.Slot) (*evmInt256.Int, error)
}

type Storage

type Storage struct {
	ResultCache cache.ResultCache
	// contains filtered or unexported fields
}

func New

func New(extStorage IExternalStorage) *Storage

func (*Storage) AccountWithoutCache added in v0.5.1

func (s *Storage) AccountWithoutCache(addr types.Address) (*environment.Account, error)

func (*Storage) Balance

func (s *Storage) Balance(address types.Address) (*evmInt256.Int, error)

func (*Storage) CacheAccount added in v0.5.0

func (s *Storage) CacheAccount(acc *environment.Account, newContract bool)

func (*Storage) CachedContract added in v0.4.1

func (s *Storage) CachedContract(addr types.Address) bool

func (*Storage) CachedData added in v0.4.1

func (s *Storage) CachedData(addr types.Address, slot types.Slot) (org *evmInt256.Int, current *evmInt256.Int)

func (*Storage) CanTransfer

func (s *Storage) CanTransfer(from types.Address, to types.Address, amount *evmInt256.Int) bool

func (*Storage) ClearCache added in v0.2.2

func (s *Storage) ClearCache()

func (*Storage) Clone added in v0.2.2

func (s *Storage) Clone() *Storage

func (*Storage) ContractEmpty added in v0.4.1

func (s *Storage) ContractEmpty(addr types.Address) bool

func (*Storage) ContractExist added in v0.4.1

func (s *Storage) ContractExist(addr types.Address) bool

func (*Storage) CreateAddress added in v0.2.2

func (s *Storage) CreateAddress(caller types.Address, tx environment.Transaction) types.Address

func (*Storage) CreateFixedAddress added in v0.2.2

func (s *Storage) CreateFixedAddress(caller types.Address, salt types.Hash, code []byte, tx environment.Transaction) types.Address

func (*Storage) Destruct

func (s *Storage) Destruct(address types.Address)

func (*Storage) GetAccount added in v0.5.0

func (s *Storage) GetAccount(address types.Address) (*environment.Account, error)

func (*Storage) GetBlockHash

func (s *Storage) GetBlockHash(block *evmInt256.Int) (*evmInt256.Int, error)

func (*Storage) GetCode

func (s *Storage) GetCode(address types.Address) ([]byte, error)

func (*Storage) GetCodeHash

func (s *Storage) GetCodeHash(address types.Address) (*types.Hash, error)

func (*Storage) GetCodeSize

func (s *Storage) GetCodeSize(address types.Address) (*evmInt256.Int, error)

func (*Storage) GetExternalStorage added in v0.2.2

func (s *Storage) GetExternalStorage() IExternalStorage

func (*Storage) HashOfCode added in v0.4.0

func (s *Storage) HashOfCode(code []byte) types.Hash

func (*Storage) Log

func (s *Storage) Log(log *types.Log)

func (*Storage) RemoveCachedAccount added in v0.5.0

func (s *Storage) RemoveCachedAccount(addr types.Address)

func (*Storage) Transfer added in v0.4.1

func (s *Storage) Transfer(fromAddr types.Address, toAddr types.Address, val *evmInt256.Int) error

func (*Storage) UpdateAccountContract added in v0.5.0

func (s *Storage) UpdateAccountContract(address types.Address, code []byte)

func (*Storage) XLoad added in v0.2.0

func (s *Storage) XLoad(address types.Address, slot types.Slot, t cache.TypeOfStorage) (*evmInt256.Int, error)

func (*Storage) XStore added in v0.2.0

func (s *Storage) XStore(address types.Address, slot types.Slot, val *evmInt256.Int, t cache.TypeOfStorage)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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