Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions triedb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ var HashDefaults = &Config{
HashDB: hashdb.Defaults,
}

// backend defines the methods needed to access/update trie nodes in different
// state scheme.
type backend interface {
// Backend defines the methods needed to access/update trie nodes in different
// state schemes.
type Backend interface {
// Scheme returns the identifier of used storage scheme.
Scheme() string

Expand Down Expand Up @@ -87,7 +87,7 @@ type Database struct {
config *Config // Configuration for trie database
diskdb ethdb.Database // Persistent database to store the snapshot
preimages *preimageStore // The store for caching preimages
backend backend // The backend for managing trie nodes
backend Backend // The backend for managing trie nodes
}

// NewDatabase initializes the trie database with default settings, note
Expand Down Expand Up @@ -343,3 +343,9 @@ func (db *Database) SetBufferSize(size int) error {
func (db *Database) IsVerkle() bool {
return db.config.IsVerkle
}

// Backend returns the underlying backend of the trie database, which
// implements the methods for accessing additional custom methods.
func (db *Database) Backend() Backend {
return db.backend
}
2 changes: 1 addition & 1 deletion triedb/database.libevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
// BackendDB defines the intersection of methods shared by [hashdb.Database] and
// [pathdb.Database]. It is defined to export an otherwise internal type used by
// the non-libevm geth implementation.
type BackendDB backend
type BackendDB Backend

// A ReaderProvider exposes its underlying Reader as an interface. Both
// [hashdb.Database] and [pathdb.Database] return concrete types so Go's lack of
Expand Down
Loading