Documentation
¶
Index ¶
- func MergeResultCache(src *ResultCache, to *ResultCache)
- type BalanceCache
- type Cache
- type CacheUnderNamespace
- type CodeCache
- type IExternalStorage
- type Log
- type LogCache
- type ResultCache
- func (r *ResultCache) Clone() ResultCache
- func (r *ResultCache) XCachedLoad(namespace string, key string, t TypeOfStorage) *evmInt256.Int
- func (r *ResultCache) XCachedStore(namespace string, key string, v *evmInt256.Int, t TypeOfStorage)
- func (r *ResultCache) XOriginalLoad(namespace string, key string, t TypeOfStorage) *evmInt256.Int
- func (r *ResultCache) XOriginalStore(namespace string, key string, v *evmInt256.Int, t TypeOfStorage)
- type Storage
- func (s *Storage) Balance(address *evmInt256.Int) (*evmInt256.Int, error)
- func (s *Storage) BalanceModify(address *evmInt256.Int, value *evmInt256.Int, neg bool)
- func (s *Storage) CanTransfer(from *evmInt256.Int, to *evmInt256.Int, amount *evmInt256.Int) bool
- func (s *Storage) ClearCache()
- func (s *Storage) Clone() *Storage
- func (s *Storage) CreateAddress(caller *evmInt256.Int, tx environment.Transaction) *evmInt256.Int
- func (s *Storage) CreateFixedAddress(caller *evmInt256.Int, salt *evmInt256.Int, tx environment.Transaction) *evmInt256.Int
- func (s *Storage) Destruct(address *evmInt256.Int)
- func (s *Storage) GetBlockHash(block *evmInt256.Int) (*evmInt256.Int, error)
- func (s *Storage) GetCode(address *evmInt256.Int) ([]byte, error)
- func (s *Storage) GetCodeHash(address *evmInt256.Int) (*evmInt256.Int, error)
- func (s *Storage) GetCodeSize(address *evmInt256.Int) (*evmInt256.Int, error)
- func (s *Storage) GetExternalStorage() IExternalStorage
- func (s *Storage) Log(address *evmInt256.Int, topics [][]byte, data []byte, ...)
- func (s *Storage) NewContract(address *evmInt256.Int, code []byte) error
- func (s *Storage) XLoad(n *evmInt256.Int, k *evmInt256.Int, t TypeOfStorage) (*evmInt256.Int, error)
- func (s *Storage) XStore(n *evmInt256.Int, k *evmInt256.Int, v *evmInt256.Int, t TypeOfStorage)
- type TypeOfStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeResultCache ¶
func MergeResultCache(src *ResultCache, to *ResultCache)
Types ¶
type BalanceCache ¶
type BalanceCache map[string]*balance
func (BalanceCache) Clone ¶ added in v0.2.2
func (b BalanceCache) Clone() BalanceCache
func (BalanceCache) Merge ¶ added in v0.2.3
func (b BalanceCache) Merge(cache BalanceCache)
type CacheUnderNamespace ¶
func (CacheUnderNamespace) Clone ¶ added in v0.2.2
func (c CacheUnderNamespace) Clone() CacheUnderNamespace
func (CacheUnderNamespace) Get ¶
func (c CacheUnderNamespace) Get(namespace string, key string) *evmInt256.Int
func (CacheUnderNamespace) Merge ¶ added in v0.2.3
func (c CacheUnderNamespace) Merge(cache CacheUnderNamespace)
type IExternalStorage ¶
type IExternalStorage interface { GetBalance(address *evmInt256.Int) (*evmInt256.Int, error) GetCode(address *evmInt256.Int) ([]byte, error) GetCodeSize(address *evmInt256.Int) (*evmInt256.Int, error) GetCodeHash(address *evmInt256.Int) (*evmInt256.Int, error) GetBlockHash(block *evmInt256.Int) (*evmInt256.Int, error) CreateAddress(caller *evmInt256.Int, tx environment.Transaction) *evmInt256.Int CreateFixedAddress(caller *evmInt256.Int, salt *evmInt256.Int, tx environment.Transaction) *evmInt256.Int CanTransfer(from *evmInt256.Int, to *evmInt256.Int, amount *evmInt256.Int) bool Load(n string, k string) (*evmInt256.Int, error) TLoad(n string, k string) (*evmInt256.Int, error) NewContract(n string, code []byte) error }
type ResultCache ¶
type ResultCache struct { OriginalData CacheUnderNamespace CachedData CacheUnderNamespace TOriginalData CacheUnderNamespace TCachedData CacheUnderNamespace Balance BalanceCache Logs *LogCache Destructs Cache }
func NewResultCache ¶ added in v0.2.2
func NewResultCache() ResultCache
func (*ResultCache) Clone ¶ added in v0.2.2
func (r *ResultCache) Clone() ResultCache
func (*ResultCache) XCachedLoad ¶ added in v0.2.0
func (r *ResultCache) XCachedLoad(namespace string, key string, t TypeOfStorage) *evmInt256.Int
func (*ResultCache) XCachedStore ¶ added in v0.2.0
func (r *ResultCache) XCachedStore(namespace string, key string, v *evmInt256.Int, t TypeOfStorage)
func (*ResultCache) XOriginalLoad ¶ added in v0.2.0
func (r *ResultCache) XOriginalLoad(namespace string, key string, t TypeOfStorage) *evmInt256.Int
func (*ResultCache) XOriginalStore ¶ added in v0.2.0
func (r *ResultCache) XOriginalStore(namespace string, key string, v *evmInt256.Int, t TypeOfStorage)
type Storage ¶
type Storage struct { ResultCache ResultCache // contains filtered or unexported fields }
func New ¶
func New(extStorage IExternalStorage) *Storage
func (*Storage) BalanceModify ¶
func (*Storage) CanTransfer ¶
func (*Storage) ClearCache ¶ added in v0.2.2
func (s *Storage) ClearCache()
func (*Storage) CreateAddress ¶ added in v0.2.2
func (s *Storage) CreateAddress(caller *evmInt256.Int, tx environment.Transaction) *evmInt256.Int
func (*Storage) CreateFixedAddress ¶ added in v0.2.2
func (s *Storage) CreateFixedAddress(caller *evmInt256.Int, salt *evmInt256.Int, tx environment.Transaction) *evmInt256.Int
func (*Storage) GetBlockHash ¶
func (*Storage) GetCodeHash ¶
func (*Storage) GetCodeSize ¶
func (*Storage) GetExternalStorage ¶ added in v0.2.2
func (s *Storage) GetExternalStorage() IExternalStorage
func (*Storage) NewContract ¶
type TypeOfStorage ¶ added in v0.2.0
type TypeOfStorage int
const ( SStorage TypeOfStorage = 1 TStorage TypeOfStorage = 2 )
Click to show internal directories.
Click to hide internal directories.