mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 11:20:45 +00:00
chore!(triedb): remove config argument for DBConstructor (#167)
This commit is contained in:
parent
7be6bee7ab
commit
87a2d57b96
2 changed files with 3 additions and 3 deletions
|
|
@ -42,7 +42,7 @@ type ReaderProvider interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
// A DBConstructor constructs alternative backend-database implementations.
|
// A DBConstructor constructs alternative backend-database implementations.
|
||||||
type DBConstructor func(ethdb.Database, *Config) DBOverride
|
type DBConstructor func(ethdb.Database) DBOverride
|
||||||
|
|
||||||
// A DBOverride is an arbitrary implementation of a [Database] backend. It MUST
|
// A DBOverride is an arbitrary implementation of a [Database] backend. It MUST
|
||||||
// be either a [HashDB] or a [PathDB].
|
// be either a [HashDB] or a [PathDB].
|
||||||
|
|
@ -59,7 +59,7 @@ func (db *Database) overrideBackend(diskdb ethdb.Database, config *Config) bool
|
||||||
log.Crit("Database override provided when 'hash' or 'path' mode are configured")
|
log.Crit("Database override provided when 'hash' or 'path' mode are configured")
|
||||||
}
|
}
|
||||||
|
|
||||||
db.backend = config.DBOverride(diskdb, config)
|
db.backend = config.DBOverride(diskdb)
|
||||||
switch db.backend.(type) {
|
switch db.backend.(type) {
|
||||||
case HashDB:
|
case HashDB:
|
||||||
case PathDB:
|
case PathDB:
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ import (
|
||||||
|
|
||||||
func TestDBOverride(t *testing.T) {
|
func TestDBOverride(t *testing.T) {
|
||||||
config := &Config{
|
config := &Config{
|
||||||
DBOverride: func(d ethdb.Database, c *Config) DBOverride {
|
DBOverride: func(d ethdb.Database) DBOverride {
|
||||||
return override{}
|
return override{}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue