test: Add test for diffrent signet data directories

- Added a test to verify the Signet data directory when -signetchallenge=51 is correctly set to 'signet_da1745e9'.
- Added a test to verify the main Signet data directory is correctly set to 'signet'.
This commit is contained in:
Brandon Odiwuor 2024-05-19 12:53:36 +03:00
parent f1b40b4de4
commit 32c3a732c1

View file

@ -5,6 +5,7 @@
"""Test basic signet functionality""" """Test basic signet functionality"""
from decimal import Decimal from decimal import Decimal
from os import path
from test_framework.test_framework import BitcoinTestFramework from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal from test_framework.util import assert_equal
@ -73,6 +74,12 @@ class SignetBasicTest(BitcoinTestFramework):
assert_equal(self.nodes[4].submitblock(signet_blocks[0]), 'bad-signet-blksig') assert_equal(self.nodes[4].submitblock(signet_blocks[0]), 'bad-signet-blksig')
self.log.info("Test that the signet data directory with -signetchallenge=51 is 'signet_da1745e9'")
assert_equal(path.basename(self.nodes[0].chain_path), "signet_da1745e9")
self.log.info("Test that the main signet data directory is 'signet'")
assert_equal(path.basename(self.nodes[3].chain_path), "signet")
self.log.info("test that signet logs the network magic on node start") self.log.info("test that signet logs the network magic on node start")
with self.nodes[0].assert_debug_log(["Signet derived magic (message start)"]): with self.nodes[0].assert_debug_log(["Signet derived magic (message start)"]):
self.restart_node(0) self.restart_node(0)