forked from cerc-io/plugeth
all: expose block number information to statedb (#27753)
* core/state: clean up * all: add block number infomration to statedb * core, trie: rename blockNumber to block
This commit is contained in:
@@ -176,7 +176,7 @@ func (f *fuzzer) fuzz() int {
|
||||
panic(err)
|
||||
}
|
||||
if nodes != nil {
|
||||
dbA.Update(rootA, types.EmptyRootHash, trienode.NewWithNodeSet(nodes), nil)
|
||||
dbA.Update(rootA, types.EmptyRootHash, 0, trienode.NewWithNodeSet(nodes), nil)
|
||||
}
|
||||
// Flush memdb -> disk (sponge)
|
||||
dbA.Commit(rootA, false)
|
||||
|
||||
@@ -170,7 +170,7 @@ func runRandTest(rt randTest) error {
|
||||
return err
|
||||
}
|
||||
if nodes != nil {
|
||||
if err := triedb.Update(hash, origin, trienode.NewWithNodeSet(nodes), nil); err != nil {
|
||||
if err := triedb.Update(hash, origin, 0, trienode.NewWithNodeSet(nodes), nil); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh
|
||||
// the coinbase gets no txfee, so isn't created, and thus needs to be touched
|
||||
statedb.AddBalance(block.Coinbase(), new(big.Int))
|
||||
// Commit block
|
||||
root, _ := statedb.Commit(config.IsEIP158(block.Number()))
|
||||
root, _ := statedb.Commit(block.NumberU64(), config.IsEIP158(block.Number()))
|
||||
return snaps, statedb, root, err
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ func MakePreState(db ethdb.Database, accounts core.GenesisAlloc, snapshotter boo
|
||||
}
|
||||
}
|
||||
// Commit and re-open to start with a clean state.
|
||||
root, _ := statedb.Commit(false)
|
||||
root, _ := statedb.Commit(0, false)
|
||||
|
||||
var snaps *snapshot.Tree
|
||||
if snapshotter {
|
||||
|
||||
Reference in New Issue
Block a user