mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
core: fix broken tests
This commit is contained in:
parent
41f85203a7
commit
24f6b1f4e7
2 changed files with 14 additions and 3 deletions
|
|
@ -256,7 +256,9 @@ func newDbConfig(scheme string) *triedb.Config {
|
||||||
if scheme == rawdb.HashScheme {
|
if scheme == rawdb.HashScheme {
|
||||||
return triedb.HashDefaults
|
return triedb.HashDefaults
|
||||||
}
|
}
|
||||||
return &triedb.Config{PathDB: pathdb.Defaults}
|
config := *pathdb.Defaults
|
||||||
|
config.NoAsyncFlush = true
|
||||||
|
return &triedb.Config{PathDB: &config}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestVerkleGenesisCommit(t *testing.T) {
|
func TestVerkleGenesisCommit(t *testing.T) {
|
||||||
|
|
@ -313,7 +315,14 @@ func TestVerkleGenesisCommit(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
db := rawdb.NewMemoryDatabase()
|
db := rawdb.NewMemoryDatabase()
|
||||||
triedb := triedb.NewDatabase(db, triedb.VerkleDefaults)
|
|
||||||
|
config := *pathdb.Defaults
|
||||||
|
config.NoAsyncFlush = true
|
||||||
|
|
||||||
|
triedb := triedb.NewDatabase(db, &triedb.Config{
|
||||||
|
IsVerkle: true,
|
||||||
|
PathDB: &config,
|
||||||
|
})
|
||||||
block := genesis.MustCommit(db, triedb)
|
block := genesis.MustCommit(db, triedb)
|
||||||
if !bytes.Equal(block.Root().Bytes(), expected) {
|
if !bytes.Equal(block.Root().Bytes(), expected) {
|
||||||
t.Fatalf("invalid genesis state root, expected %x, got %x", expected, block.Root())
|
t.Fatalf("invalid genesis state root, expected %x, got %x", expected, block.Root())
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,9 @@ func makeTestState(scheme string) (ethdb.Database, Database, *triedb.Database, c
|
||||||
// Create an empty state
|
// Create an empty state
|
||||||
config := &triedb.Config{Preimages: true}
|
config := &triedb.Config{Preimages: true}
|
||||||
if scheme == rawdb.PathScheme {
|
if scheme == rawdb.PathScheme {
|
||||||
config.PathDB = pathdb.Defaults
|
pconfig := *pathdb.Defaults
|
||||||
|
pconfig.NoAsyncFlush = true
|
||||||
|
config.PathDB = &pconfig
|
||||||
} else {
|
} else {
|
||||||
config.HashDB = hashdb.Defaults
|
config.HashDB = hashdb.Defaults
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue