statedb

package
v0.0.0-...-5fb9e85 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package statedb

@author: xwc1125

Package statedb

@author: xwc1125

Package statedb

@author: xwc1125

Package statedb

@author: xwc1125

Package statedb

@author: xwc1125

Package statedb

@author: xwc1125

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewXStore

func NewXStore(root types.Hash, db basedb.Database) (*xStore, error)

func WithConfig

func WithConfig(config *Config) option

Types

type Config

type Config struct {
	Metrics      bool   `json:"metrics" mapstructure:"metrics"`             // 是否显示指标
	MetricsLevel uint64 `json:"metrics_level" mapstructure:"metrics_level"` // 指标级别
}

func (Config) IsMetrics

func (c Config) IsMetrics(_metricsLevel uint64) bool

type EVMStateDB

type EVMStateDB struct {
	*StateDB
}

func NewEvmStateDB

func NewEvmStateDB(db *StateDB) *EVMStateDB

func (*EVMStateDB) AddBalance

func (es *EVMStateDB) AddBalance(address types.Address, amount *big.Int)

func (*EVMStateDB) CreateAccount

func (es *EVMStateDB) CreateAccount(address types.Address)

func (*EVMStateDB) Empty

func (es *EVMStateDB) Empty(address types.Address) bool

func (*EVMStateDB) Exist

func (es *EVMStateDB) Exist(address types.Address) bool

func (*EVMStateDB) ForEachStorage

func (es *EVMStateDB) ForEachStorage(address types.Address, cb func(types.Hash, types.Hash) bool) error

func (*EVMStateDB) GetBalance

func (es *EVMStateDB) GetBalance(address types.Address) *big.Int

func (*EVMStateDB) GetCode

func (es *EVMStateDB) GetCode(address types.Address) []byte

func (*EVMStateDB) GetCodeHash

func (es *EVMStateDB) GetCodeHash(address types.Address) types.Hash

func (*EVMStateDB) GetCodeSize

func (es *EVMStateDB) GetCodeSize(address types.Address) int

func (*EVMStateDB) GetCommittedState

func (es *EVMStateDB) GetCommittedState(address types.Address, hash types.Hash) types.Hash

func (*EVMStateDB) GetNonce

func (es *EVMStateDB) GetNonce(address types.Address) uint64

func (*EVMStateDB) GetState

func (es *EVMStateDB) GetState(address types.Address, hash types.Hash) types.Hash

func (*EVMStateDB) HasSuicided

func (es *EVMStateDB) HasSuicided(address types.Address) bool

func (*EVMStateDB) SetCode

func (es *EVMStateDB) SetCode(address types.Address, code []byte)

func (*EVMStateDB) SetNonce

func (es *EVMStateDB) SetNonce(address types.Address, nonce uint64)

func (*EVMStateDB) SetState

func (es *EVMStateDB) SetState(address types.Address, key, value types.Hash)

func (*EVMStateDB) SubBalance

func (es *EVMStateDB) SubBalance(address types.Address, amount *big.Int)

func (*EVMStateDB) Suicide

func (es *EVMStateDB) Suicide(address types.Address) bool

type StateDB

type StateDB struct {
	*accountdb.AccountDB
	*accountdb.AccountMap
	*accountdb.AccountKVS
	// contains filtered or unexported fields
}

func New

func New(root types.Hash, db kvstore.Database, opts ...option) (*StateDB, error)

New Create a new state from a given trie.

func (*StateDB) AddDomain

func (s *StateDB) AddDomain(domain string, store accounts.DomainStore)

func (*StateDB) AddLog

func (s *StateDB) AddLog(log *statetype.Log)

func (*StateDB) AddPreimage

func (s *StateDB) AddPreimage(hash types.Hash, preimage []byte)

func (*StateDB) AddRefund

func (s *StateDB) AddRefund(gas uint64)

AddRefund adds gas to the refund counter

func (*StateDB) Commit

func (s *StateDB) Commit(deleteEmptyObjects bool) (types.Hash, error)

func (*StateDB) CreateAccount

func (s *StateDB) CreateAccount(account *accounts.AccountStore)

func (*StateDB) Error

func (s *StateDB) Error() error

func (*StateDB) Finalise

func (s *StateDB) Finalise(deleteEmptyObjects bool)

func (*StateDB) GetDomain

func (s *StateDB) GetDomain(domain string) *accounts.DomainStore

func (*StateDB) GetLogs

func (s *StateDB) GetLogs(hash types.Hash) []*statetype.Log

func (*StateDB) GetRefund

func (s *StateDB) GetRefund() uint64

func (*StateDB) IntermediateRoot

func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) types.Hash

func (*StateDB) KVExist

func (s *StateDB) KVExist(account string, namespace string, key string) bool

func (*StateDB) Logs

func (s *StateDB) Logs() []*statetype.Log

func (*StateDB) Prepare

func (s *StateDB) Prepare(thash, bhash types.Hash, ti int)

func (*StateDB) RevertToSnapshot

func (s *StateDB) RevertToSnapshot(revid int)

RevertToSnapshot reverts all state changes made since the given revision.

func (*StateDB) SetAddress

func (s *StateDB) SetAddress(account string, address types.Address)

func (*StateDB) SetConfig

func (s *StateDB) SetConfig(config *Config)

func (*StateDB) Snapshot

func (s *StateDB) Snapshot() int

Snapshot returns an identifier for the current revision of the state.

func (*StateDB) SubRefund

func (s *StateDB) SubRefund(gas uint64)

SubRefund removes gas from the refund counter. This method will panic if the refund counter goes below zero

Directories

Path Synopsis
Package accountdb @author: xwc1125 Package accountdb @author: xwc1125 Package accountdb @author: xwc1125 Package accountdb @author: xwc1125 Package accountdb @author: xwc1125
Package accountdb @author: xwc1125 Package accountdb @author: xwc1125 Package accountdb @author: xwc1125 Package accountdb @author: xwc1125 Package accountdb @author: xwc1125
Package vmdb @author: xwc1125 Package vmdb @author: xwc1125 Package vmdb @author: xwc1125 Package vmdb @author: xwc1125 Package vmdb @author: xwc1125 Package vmdb @author: xwc1125 Package vmdb @author: xwc1125 Package vmdb @author: xwc1125
Package vmdb @author: xwc1125 Package vmdb @author: xwc1125 Package vmdb @author: xwc1125 Package vmdb @author: xwc1125 Package vmdb @author: xwc1125 Package vmdb @author: xwc1125 Package vmdb @author: xwc1125 Package vmdb @author: xwc1125
model
Package model @author: xwc1125 Package model @author: xwc1125 Package model @author: xwc1125
Package model @author: xwc1125 Package model @author: xwc1125 Package model @author: xwc1125

Jump to

Keyboard shortcuts

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