From c83a53250928964e1408378f7649a45b0e4d2794 Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Tue, 17 Dec 2024 11:22:36 +0000 Subject: [PATCH] Fix typo --- counterparty-core/counterpartycore/server.py | 2 +- counterparty-core/counterpartycore/test/conftest.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/counterparty-core/counterpartycore/server.py b/counterparty-core/counterpartycore/server.py index 371211b85..f7b932802 100755 --- a/counterparty-core/counterpartycore/server.py +++ b/counterparty-core/counterpartycore/server.py @@ -197,7 +197,7 @@ def initialise_config( if not cache_dir: cache_dir = appdirs.user_cache_dir(appauthor=config.XCP_NAME, appname=config.APP_NAME) if not os.path.isdir(cache_dir): - os.makedirs(config.CACHE_DIR, mode=0o755) + os.makedirs(cache_dir, mode=0o755) config.CACHE_DIR = cache_dir # testnet diff --git a/counterparty-core/counterpartycore/test/conftest.py b/counterparty-core/counterpartycore/test/conftest.py index 4b3e70dc9..c6b0c64a0 100644 --- a/counterparty-core/counterpartycore/test/conftest.py +++ b/counterparty-core/counterpartycore/test/conftest.py @@ -227,6 +227,7 @@ def server_db(request, cp_server, api_server): cursor = db.cursor() cursor.execute("""BEGIN""") util_test.reset_current_block_index(db) + config.CACHE_DIR = os.path.dirname(request.module.FIXTURE_DB) request.addfinalizer(lambda: cursor.execute("""ROLLBACK""")) request.addfinalizer(lambda: util_test.reset_current_block_index(db)) @@ -245,6 +246,7 @@ def api_server(request, cp_server): config.RPC_PORT = TEST_RPC_PORT = TEST_RPC_PORT + 1 server.configure_rpc(config.RPC_PASSWORD) + config.CACHE_DIR = os.path.dirname(request.module.FIXTURE_DB) print("api_server", config.DATABASE, config.STATE_DATABASE) @@ -323,7 +325,7 @@ def api_server_v2(request, cp_server): "max_log_file_rotations": 20, "log_exclude_filters": None, "log_include_filters": None, - "cache_dir": None, + "cache_dir": os.path.dirname(request.module.FIXTURE_DB), } server_config = ( default_config @@ -336,6 +338,7 @@ def api_server_v2(request, cp_server): ) config.STATE_DATABASE = config.STATE_DATABASE.replace(".testnet.db", ".db") + config.CACHE_DIR = os.path.dirname(request.module.FIXTURE_DB) if os.path.exists(config.STATE_DATABASE): os.unlink(config.STATE_DATABASE)