@@ -37,7 +37,7 @@ type Config struct {
3737 HashDB * hashdb.Config // Configs for hash-based scheme
3838 PathDB * pathdb.Config // Configs for experimental path-based scheme
3939
40- DBOverride BackendConstructor // Injects an arbitrary backend implementation
40+ DBOverride DBConstructor // Injects an arbitrary backend-database implementation
4141}
4242
4343// HashDefaults represents a config for using hash-based scheme with
@@ -228,7 +228,7 @@ func (db *Database) InsertPreimage(preimages map[common.Hash][]byte) {
228228//
229229// It's only supported by hash-based database and will return an error for others.
230230func (db * Database ) Cap (limit common.StorageSize ) error {
231- hdb , ok := db .backend .(HashBackend )
231+ hdb , ok := db .backend .(HashDB )
232232 if ! ok {
233233 return errors .New ("not supported" )
234234 }
@@ -244,7 +244,7 @@ func (db *Database) Cap(limit common.StorageSize) error {
244244//
245245// It's only supported by hash-based database and will return an error for others.
246246func (db * Database ) Reference (root common.Hash , parent common.Hash ) error {
247- hdb , ok := db .backend .(HashBackend )
247+ hdb , ok := db .backend .(HashDB )
248248 if ! ok {
249249 return errors .New ("not supported" )
250250 }
@@ -255,7 +255,7 @@ func (db *Database) Reference(root common.Hash, parent common.Hash) error {
255255// Dereference removes an existing reference from a root node. It's only
256256// supported by hash-based database and will return an error for others.
257257func (db * Database ) Dereference (root common.Hash ) error {
258- hdb , ok := db .backend .(HashBackend )
258+ hdb , ok := db .backend .(HashDB )
259259 if ! ok {
260260 return errors .New ("not supported" )
261261 }
@@ -268,7 +268,7 @@ func (db *Database) Dereference(root common.Hash) error {
268268// corresponding trie histories are existent. It's only supported by path-based
269269// database and will return an error for others.
270270func (db * Database ) Recover (target common.Hash ) error {
271- pdb , ok := db .backend .(PathBackend )
271+ pdb , ok := db .backend .(PathDB )
272272 if ! ok {
273273 return errors .New ("not supported" )
274274 }
@@ -286,7 +286,7 @@ func (db *Database) Recover(target common.Hash) error {
286286// recovered. It's only supported by path-based database and will return an
287287// error for others.
288288func (db * Database ) Recoverable (root common.Hash ) (bool , error ) {
289- pdb , ok := db .backend .(PathBackend )
289+ pdb , ok := db .backend .(PathDB )
290290 if ! ok {
291291 return false , errors .New ("not supported" )
292292 }
@@ -299,7 +299,7 @@ func (db *Database) Recoverable(root common.Hash) (bool, error) {
299299//
300300// It's only supported by path-based database and will return an error for others.
301301func (db * Database ) Disable () error {
302- pdb , ok := db .backend .(PathBackend )
302+ pdb , ok := db .backend .(PathDB )
303303 if ! ok {
304304 return errors .New ("not supported" )
305305 }
@@ -309,7 +309,7 @@ func (db *Database) Disable() error {
309309// Enable activates database and resets the state tree with the provided persistent
310310// state root once the state sync is finished.
311311func (db * Database ) Enable (root common.Hash ) error {
312- pdb , ok := db .backend .(PathBackend )
312+ pdb , ok := db .backend .(PathDB )
313313 if ! ok {
314314 return errors .New ("not supported" )
315315 }
@@ -321,7 +321,7 @@ func (db *Database) Enable(root common.Hash) error {
321321// flattening everything down (bad for reorgs). It's only supported by path-based
322322// database and will return an error for others.
323323func (db * Database ) Journal (root common.Hash ) error {
324- pdb , ok := db .backend .(PathBackend )
324+ pdb , ok := db .backend .(PathDB )
325325 if ! ok {
326326 return errors .New ("not supported" )
327327 }
@@ -332,7 +332,7 @@ func (db *Database) Journal(root common.Hash) error {
332332// It's only supported by path-based database and will return an error for
333333// others.
334334func (db * Database ) SetBufferSize (size int ) error {
335- pdb , ok := db .backend .(PathBackend )
335+ pdb , ok := db .backend .(PathDB )
336336 if ! ok {
337337 return errors .New ("not supported" )
338338 }
0 commit comments