core: fix broken tests due to API changes + linter

This commit is contained in:
Péter Szilágyi
2020-02-24 13:26:34 +02:00
parent 19099421dc
commit 06d4470b41
18 changed files with 55 additions and 182 deletions

View File

@ -41,7 +41,7 @@ type testAccount struct {
func makeTestState() (Database, common.Hash, []*testAccount) {
// Create an empty state
db := NewDatabase(rawdb.NewMemoryDatabase())
state, _ := New(common.Hash{}, db)
state, _ := New(common.Hash{}, db, nil)
// Fill it with some arbitrary data
accounts := []*testAccount{}
@ -72,7 +72,7 @@ func makeTestState() (Database, common.Hash, []*testAccount) {
// account array.
func checkStateAccounts(t *testing.T, db ethdb.Database, root common.Hash, accounts []*testAccount) {
// Check root availability and state contents
state, err := New(root, NewDatabase(db))
state, err := New(root, NewDatabase(db), nil)
if err != nil {
t.Fatalf("failed to create state trie at %x: %v", root, err)
}
@ -113,7 +113,7 @@ func checkStateConsistency(db ethdb.Database, root common.Hash) error {
if _, err := db.Get(root.Bytes()); err != nil {
return nil // Consider a non existent state consistent.
}
state, err := New(root, NewDatabase(db))
state, err := New(root, NewDatabase(db), nil)
if err != nil {
return err
}