Skip to content

Commit ef056ea

Browse files
committed
address comments
1 parent a6e95c4 commit ef056ea

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

triedb/database.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ var HashDefaults = &Config{
4747
HashDB: hashdb.Defaults,
4848
}
4949

50-
// Backend defines the methods needed to access/update trie nodes in different
51-
// state schemes.
52-
type Backend interface {
50+
// backend defines the methods needed to access/update trie nodes in different
51+
// state scheme.
52+
type backend interface {
5353
// Scheme returns the identifier of used storage scheme.
5454
Scheme() string
5555

@@ -87,7 +87,7 @@ type Database struct {
8787
config *Config // Configuration for trie database
8888
diskdb ethdb.Database // Persistent database to store the snapshot
8989
preimages *preimageStore // The store for caching preimages
90-
backend Backend // The backend for managing trie nodes
90+
backend backend // The backend for managing trie nodes
9191
}
9292

9393
// NewDatabase initializes the trie database with default settings, note
@@ -343,9 +343,3 @@ func (db *Database) SetBufferSize(size int) error {
343343
func (db *Database) IsVerkle() bool {
344344
return db.config.IsVerkle
345345
}
346-
347-
// Backend returns the underlying backend of the trie database, which
348-
// implements the methods for accessing additional custom methods.
349-
func (db *Database) Backend() Backend {
350-
return db.backend
351-
}

triedb/database.libevm.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
// BackendDB defines the intersection of methods shared by [hashdb.Database] and
3030
// [pathdb.Database]. It is defined to export an otherwise internal type used by
3131
// the non-libevm geth implementation.
32-
type BackendDB Backend
32+
type BackendDB backend
3333

3434
// A ReaderProvider exposes its underlying Reader as an interface. Both
3535
// [hashdb.Database] and [pathdb.Database] return concrete types so Go's lack of
@@ -51,6 +51,11 @@ type DBOverride interface {
5151
ReaderProvider
5252
}
5353

54+
// Backend returns the underlying backend of the trie database.
55+
func (db *Database) Backend() BackendDB {
56+
return db.backend
57+
}
58+
5459
func (db *Database) overrideBackend(diskdb ethdb.Database, config *Config) bool {
5560
if config.DBOverride == nil {
5661
return false

0 commit comments

Comments
 (0)