nimbus-eth1/nimbus/db/core_db.nim
Jordan Hrycaj a02a915039
Provide public default db symbol (#2050)
* CoreDb: Provide default db backend symbols

why:
  Handy for running `Aristo` against standard tests

note:
  These defaults are currently set to legacy DB types. The must be
  enabled manually in `db/core_db.nim`.

* Provide `Aristo` for macro assembler related tests

caveat:
  Some tests use `initStorageTrie()` which lets `Aristo` bail out. The
  test need to run on `distinct_ledgers` (or something like) rather than
  `distinct_tries`.

* Tests: Misc modules that can run on `Aristo` as well

* NoHive: Module that can run on `Aristo` as well

* Fix copyright year

* ditto
2024-02-23 09:17:24 +00:00

45 lines
1.6 KiB
Nim

# Nimbus
# Copyright (c) 2023-2024 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
# http://www.apache.org/licenses/LICENSE-2.0)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
# http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
## Core database replacement wrapper object
## ========================================
##
## See `core_db/README.md` for implementation details
##
## This module provides a memory datanase only. For providing a persistent
## constructor, import `db/code_db/persistent` though avoiding to
## unnecessarily link to the persistent backend library (e.g. `rocksdb`)
## when a memory only database is used.
##
{.push raises: [].}
import
./core_db/memory_only
export
memory_only
# Default database backend selection. Note that an `Aristo` type backend
# should run on a `LedgerCache` type ledger (will not work with
# `LegacyAccountsCache`.) The `common` module automatically sets that up
# (unless overridden.) Practically, these constants are mainly used for
# setting up DB agnostic unit/integration tests.
#
# Uncomment the below symbols in order to activate the `Aristo` database.
#const DefaultDbMemory* = AristoDbMemory
#const DefaultDbPersistent* = AristoDbRocks
# Catch undefined symbols and set them to the legacy database.
when not declared(DefaultDbMemory):
const DefaultDbMemory* = LegacyDbMemory
when not declared(DefaultDbPersistent):
const DefaultDbPersistent* = LegacyDbPersistent
# End