Skip to content

Commit c923fda

Browse files
committed
env: rm DB_ENGINE default value
1 parent f534365 commit c923fda

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/electrumx/server/env.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,6 @@ def db_engine_enum(self) -> str:
224224
choices = list_db_engine_choices()
225225
db_eng = self.default('DB_ENGINE', None)
226226

227-
if db_eng is None and electrumx.__version__.startswith("1."): # temporary legacy hack
228-
db_eng = "leveldb"
229227
if db_eng is None:
230228
raise self.Error(
231229
f"required envvar DB_ENGINE not set.\n"

tests/server/test_env.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
base_environ = {
1818
'DB_DIRECTORY': BASE_DB_DIR,
19+
'DB_ENGINE': 'rocksdb',
1920
'DAEMON_URL': BASE_DAEMON_URL,
2021
'COIN': 'BitcoinSV',
2122
}
@@ -307,15 +308,17 @@ def test_DONATION_ADDRESS():
307308

308309

309310
def test_DB_ENGINE():
311+
assert_required('DB_ENGINE')
310312
setup_base_env()
311313

312-
e = Env()
313-
assert e.db_engine == "leveldb"
314-
315314
os.environ['DB_ENGINE'] = "rocksdb"
316315
e = Env()
317316
assert e.db_engine == "rocksdb"
318317

318+
os.environ['DB_ENGINE'] = "leveldb"
319+
e = Env()
320+
assert e.db_engine == "leveldb"
321+
319322
os.environ['DB_ENGINE'] = "custom-something"
320323
with pytest.raises(Env.Error):
321324
e = Env()

0 commit comments

Comments
 (0)