Documentation ¶
Index ¶
- func NewJournal() *journal
- type ActiveVersionValue
- type Chain
- func (c *Chain) AddBlock()
- func (c *Chain) AddBlockWithSnapDB(miner bool, ...) error
- func (c *Chain) AddBlockWithTxHash(txHash common.Hash)
- func (c *Chain) AddBlockWithTxHashAndCommit(txHash common.Hash, miner bool, ...) error
- func (c *Chain) CurrentForkHeader() *types.Header
- func (c *Chain) CurrentHeader() *types.Header
- func (c *Chain) GetHeaderByHash(hash common.Hash) *types.Header
- func (c *Chain) GetHeaderByNumber(number uint64) *types.Header
- func (c *Chain) SetCoinbaseGenerate(f func() common.Address)
- func (c *Chain) SetHeaderTimeGenerate(f func(uint64) uint64)
- type MockStateDB
- func (s *MockStateDB) AddBalance(adr common.Address, amount *big.Int)
- func (s *MockStateDB) AddLog(logInfo *types.Log)
- func (s *MockStateDB) AddPreimage(common.Hash, []byte)
- func (s *MockStateDB) AddRefund(uint64)
- func (s *MockStateDB) CreateAccount(addr common.Address)
- func (lhs *MockStateDB) DeepCopy(rhs *MockStateDB)
- func (s *MockStateDB) Empty(common.Address) bool
- func (s *MockStateDB) Equal(other *MockStateDB) bool
- func (s *MockStateDB) Exist(common.Address) bool
- func (s *MockStateDB) ForEachStorage(addr common.Address, fn func([]byte, []byte) bool)
- func (s *MockStateDB) GetBalance(adr common.Address) *big.Int
- func (s *MockStateDB) GetCode(addr common.Address) []byte
- func (s *MockStateDB) GetCodeHash(addr common.Address) common.Hash
- func (s *MockStateDB) GetCodeSize(addr common.Address) int
- func (s *MockStateDB) GetCommittedState(common.Address, []byte) []byte
- func (state *MockStateDB) GetCurrentActiveVersion() uint32
- func (s *MockStateDB) GetLogs(hash common.Hash) []*types.Log
- func (s *MockStateDB) GetNonce(addr common.Address) uint64
- func (s *MockStateDB) GetRefund() uint64
- func (s *MockStateDB) GetState(adr common.Address, key []byte) []byte
- func (s *MockStateDB) HasSuicided(addr common.Address) bool
- func (s *MockStateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash
- func (s *MockStateDB) MigrateStorage(from, to common.Address)
- func (s *MockStateDB) Prepare(thash, bhash common.Hash, ti int)
- func (s *MockStateDB) RevertToSnapshot(snapshot int)
- func (s *MockStateDB) SetCode(addr common.Address, code []byte)
- func (s *MockStateDB) SetNonce(addr common.Address, nonce uint64)
- func (s *MockStateDB) SetState(adr common.Address, key, val []byte)
- func (s *MockStateDB) Snapshot() int
- func (s *MockStateDB) SubBalance(adr common.Address, amount *big.Int)
- func (s *MockStateDB) SubRefund(uint64)
- func (s *MockStateDB) Suicide(addr common.Address) bool
- func (s *MockStateDB) TxHash() common.Hash
- func (s *MockStateDB) TxIdx() uint32
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActiveVersionValue ¶
type Chain ¶
type Chain struct { Genesis *types.Block // chain []common.Hash // headerm map[common.Hash]*types.Header // blockm map[common.Hash]*types.Block // receiptm map[common.Hash][]*types.Receipt StateDB *MockStateDB SnapDB snapshotdb.DB // contains filtered or unexported fields }
func (*Chain) AddBlockWithSnapDB ¶
func (*Chain) AddBlockWithTxHash ¶
func (*Chain) AddBlockWithTxHashAndCommit ¶
func (*Chain) CurrentForkHeader ¶
func (*Chain) CurrentHeader ¶
func (*Chain) SetCoinbaseGenerate ¶
func (*Chain) SetHeaderTimeGenerate ¶
type MockStateDB ¶
type MockStateDB struct { Code map[common.Address][]byte CodeHash map[common.Address][]byte Nonce map[common.Address]uint64 Suicided map[common.Address]bool Balance map[common.Address]*big.Int State map[common.Address]map[string][]byte Thash, Bhash common.Hash TxIndex int Logs map[common.Hash][]*types.Log Journal *journal // contains filtered or unexported fields }
func NewMockStateDB ¶
func NewMockStateDB() *MockStateDB
func (*MockStateDB) AddBalance ¶
func (s *MockStateDB) AddBalance(adr common.Address, amount *big.Int)
func (*MockStateDB) AddLog ¶
func (s *MockStateDB) AddLog(logInfo *types.Log)
func (*MockStateDB) AddPreimage ¶
func (s *MockStateDB) AddPreimage(common.Hash, []byte)
func (*MockStateDB) AddRefund ¶
func (s *MockStateDB) AddRefund(uint64)
func (*MockStateDB) CreateAccount ¶
func (s *MockStateDB) CreateAccount(addr common.Address)
func (*MockStateDB) DeepCopy ¶
func (lhs *MockStateDB) DeepCopy(rhs *MockStateDB)
func (*MockStateDB) Empty ¶
func (s *MockStateDB) Empty(common.Address) bool
Empty returns whether the given account is empty. Empty is defined according to EIP161 (balance = nonce = code = 0).
func (*MockStateDB) Equal ¶
func (s *MockStateDB) Equal(other *MockStateDB) bool
func (*MockStateDB) Exist ¶
func (s *MockStateDB) Exist(common.Address) bool
Exist reports whether the given account exists in state. Notably this should also return true for suicided accounts.
func (*MockStateDB) ForEachStorage ¶
func (*MockStateDB) GetBalance ¶
func (s *MockStateDB) GetBalance(adr common.Address) *big.Int
func (*MockStateDB) GetCodeHash ¶
func (s *MockStateDB) GetCodeHash(addr common.Address) common.Hash
func (*MockStateDB) GetCodeSize ¶
func (s *MockStateDB) GetCodeSize(addr common.Address) int
func (*MockStateDB) GetCommittedState ¶
func (s *MockStateDB) GetCommittedState(common.Address, []byte) []byte
func (*MockStateDB) GetCurrentActiveVersion ¶
func (state *MockStateDB) GetCurrentActiveVersion() uint32
func (*MockStateDB) GetRefund ¶
func (s *MockStateDB) GetRefund() uint64
func (*MockStateDB) GetState ¶
func (s *MockStateDB) GetState(adr common.Address, key []byte) []byte
func (*MockStateDB) HasSuicided ¶
func (s *MockStateDB) HasSuicided(addr common.Address) bool
func (*MockStateDB) IntermediateRoot ¶
func (s *MockStateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash
func (*MockStateDB) MigrateStorage ¶
func (s *MockStateDB) MigrateStorage(from, to common.Address)
func (*MockStateDB) RevertToSnapshot ¶
func (s *MockStateDB) RevertToSnapshot(snapshot int)
func (*MockStateDB) Snapshot ¶
func (s *MockStateDB) Snapshot() int
func (*MockStateDB) SubBalance ¶
func (s *MockStateDB) SubBalance(adr common.Address, amount *big.Int)
func (*MockStateDB) SubRefund ¶
func (s *MockStateDB) SubRefund(uint64)
func (*MockStateDB) TxHash ¶
func (s *MockStateDB) TxHash() common.Hash
func (*MockStateDB) TxIdx ¶
func (s *MockStateDB) TxIdx() uint32
type Transaction ¶
type Transaction func(blockHash common.Hash, header *types.Header, statedb *MockStateDB, sdb snapshotdb.DB) error
func (*Transaction) Hash ¶
func (T *Transaction) Hash() (h common.Hash)
Click to show internal directories.
Click to hide internal directories.