diff options
author | Ava Chow <github@achow101.com> | 2024-04-22 15:39:07 -0400 |
---|---|---|
committer | Ava Chow <github@achow101.com> | 2024-05-16 15:03:13 -0400 |
commit | fd7b16e391ed320e35255157a28be14c947ef30a (patch) | |
tree | 01a7514044ae03829ffb709e687ba830dd768bb6 | |
parent | 6ace3e953f0864bd7818f040c59a1bc70aa47512 (diff) | |
download | bitcoin-fd7b16e391ed320e35255157a28be14c947ef30a.tar.xz |
test: Test dumps of other endian BDB files
-rwxr-xr-x | test/functional/tool_wallet.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/functional/tool_wallet.py b/test/functional/tool_wallet.py index 704f1fe9e8..c08f96bbdc 100755 --- a/test/functional/tool_wallet.py +++ b/test/functional/tool_wallet.py @@ -454,6 +454,25 @@ class ToolWalletTest(BitcoinTestFramework): ''') self.assert_tool_output(expected_output, "-wallet=conflicts", "info") + def test_dump_endianness(self): + self.log.info("Testing dumps of the same contents with different BDB endianness") + + self.start_node(0) + self.nodes[0].createwallet("endian") + self.stop_node(0) + + wallet_dump = self.nodes[0].datadir_path / "endian.dump" + self.assert_tool_output("The dumpfile may contain private keys. To ensure the safety of your Bitcoin, do not share the dumpfile.\n", "-wallet=endian", f"-dumpfile={wallet_dump}", "dump") + expected_dump = self.read_dump(wallet_dump) + + self.do_tool_createfromdump("native_endian", "endian.dump", "bdb") + native_dump = self.read_dump(self.nodes[0].datadir_path / "rt-native_endian.dump") + self.assert_dump(expected_dump, native_dump) + + self.do_tool_createfromdump("other_endian", "endian.dump", "bdb_swap") + other_dump = self.read_dump(self.nodes[0].datadir_path / "rt-other_endian.dump") + self.assert_dump(expected_dump, other_dump) + def run_test(self): self.wallet_path = self.nodes[0].wallets_path / self.default_wallet_name / self.wallet_data_filename self.test_invalid_tool_commands_and_args() @@ -465,6 +484,7 @@ class ToolWalletTest(BitcoinTestFramework): if not self.options.descriptors: # Salvage is a legacy wallet only thing self.test_salvage() + self.test_dump_endianness() self.test_dump_createfromdump() self.test_chainless_conflicts() |