Skip to content

Commit

Permalink
test: added test coverage to loadtxoutset
Browse files Browse the repository at this point in the history
The functional test coverage did not cover the rpc error of Couldn't
open file for loadtxoutset and this test adds coverage for it
  • Loading branch information
kevkevinpal committed May 6, 2024
1 parent 1ffbd96 commit ee67bba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/functional/feature_assumeutxo.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ def test_invalid_mempool_state(self, dump_output_path):

self.restart_node(2, extra_args=self.extra_args[2])

def test_invalid_file_path(self):
self.log.info("Test bitcoind should fail when file path is invalid.")
node = self.nodes[0]
path = node.datadir_path / node.chain / "invalid" / "path"
assert_raises_rpc_error(-8, "Couldn't open file {} for reading.".format(path), node.loadtxoutset, path)

def run_test(self):
"""
Bring up two (disconnected) nodes, mine some new blocks on the first,
Expand Down Expand Up @@ -236,6 +242,7 @@ def run_test(self):
self.test_invalid_mempool_state(dump_output['path'])
self.test_invalid_snapshot_scenarios(dump_output['path'])
self.test_invalid_chainstate_scenarios()
self.test_invalid_file_path()

self.log.info(f"Loading snapshot into second node from {dump_output['path']}")
loaded = n1.loadtxoutset(dump_output['path'])
Expand Down

0 comments on commit ee67bba

Please sign in to comment.