Skip to content
This repository was archived by the owner on May 21, 2024. It is now read-only.

Commit 1a87e53

Browse files
author
Jeannette
committed
Preserve VDB code
1 parent 67d9b8c commit 1a87e53

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

core/genesis.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ func (ga *GenesisAlloc) deriveHash() (common.Hash, error) {
9797
statedb.SetState(addr, key, value)
9898
}
9999
}
100-
return statedb.Commit(false)
100+
root, _, err := statedb.Commit(false)
101+
return root, err
101102
}
102103

103104
// flush is very similar with deriveHash, but the main difference is

core/state/statedb.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (common.Hash, StateChanges, er
945945
// Merge the dirty nodes of storage trie into global set
946946
if set != nil {
947947
if err := nodes.Merge(set); err != nil {
948-
return common.Hash{}, err
948+
return common.Hash{}, StateChanges{}, err
949949
}
950950
storageTrieNodes += set.Len()
951951
}
@@ -974,7 +974,7 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (common.Hash, StateChanges, er
974974
// Merge the dirty nodes of account trie into global set
975975
if set != nil {
976976
if err := nodes.Merge(set); err != nil {
977-
return common.Hash{}, err
977+
return common.Hash{}, StateChanges{}, err
978978
}
979979
accountTrieNodes = set.Len()
980980
}
@@ -1012,7 +1012,7 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (common.Hash, StateChanges, er
10121012
}
10131013

10141014
if err := s.db.TrieDB().Update(nodes); err != nil {
1015-
return common.Hash{}, err
1015+
return common.Hash{}, StateChanges{}, err
10161016
}
10171017
s.originalRoot = root
10181018
return root, stateChanges, err

core/state/statedb_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ func TestFlushOrderDataLoss(t *testing.T) {
10431043
state.SetState(common.Address{a}, common.Hash{a, s}, common.Hash{a, s})
10441044
}
10451045
}
1046-
root, err := state.Commit(false)
1046+
root, _, err := state.Commit(false)
10471047
if err != nil {
10481048
t.Fatalf("failed to commit state trie: %v", err)
10491049
}

eth/filters/filter_system_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,8 +741,8 @@ func TestStateChangeSubscription(t *testing.T) {
741741

742742
var (
743743
db = rawdb.NewMemoryDatabase()
744-
backend = &testBackend{db: db}
745-
api = NewFilterAPI(backend, false, deadline)
744+
backend, sys = newTestFilterSystem(t, db, Config{})
745+
api = NewFilterAPI(sys, false)
746746
genesis = (&core.Genesis{BaseFee: big.NewInt(params.InitialBaseFee)}).MustCommit(db)
747747
numberOfBlocks = 3
748748
chain, _ = core.GenerateChain(params.TestChainConfig, genesis, ethash.NewFaker(), db, numberOfBlocks, func(i int, gen *core.BlockGen) {})

internal/ethapi/transaction_args_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,5 +338,8 @@ func (b *backendMock) SubscribePendingLogsEvent(ch chan<- []*types.Log) event.Su
338338
func (b *backendMock) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription {
339339
return nil
340340
}
341+
func (b *backendMock) SubscribeStateChangeEvent(ch chan<- core.StateChangeEvent) event.Subscription {
342+
return nil
343+
}
341344

342345
func (b *backendMock) Engine() consensus.Engine { return nil }

0 commit comments

Comments
 (0)