Merge bitcoin/bitcoin#25253: test: add coverage for non-hex value to -minimumchainwork

ebfc308ea4 test: add coverage for non-hex value to -minimumchainwork (brunoerg)

Pull request description:

  This PR adds test coverage for the following init error:
  b9ef5a10e2/src/init.cpp (L917-L919)

  Passing a non-hex value to -minimumchainwork should throw an initial error.

ACKs for top commit:
  laanwj:
    Code review ACK ebfc308ea4
  kristapsk:
    re-ACK ebfc308ea4

Tree-SHA512: c665903757ae3b8b2480df97bb888e60ba4387b009fcb8031041822e87a155a0e4950ebe79873c1034f0826504521d82b1fdfdb5e8378b227d14ca545b8d4e11
This commit is contained in:
MacroFake 2022-05-31 15:09:56 +02:00
commit 1f932de673
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -106,5 +106,13 @@ class MinimumChainWorkTest(BitcoinTestFramework):
# not be exercising the logic we want!)
assert_equal(self.nodes[2].getblockchaininfo()['initialblockdownload'], True)
self.log.info("Test -minimumchainwork with a non-hex value")
self.stop_node(0)
self.nodes[0].assert_start_raises_init_error(
["-minimumchainwork=test"],
expected_msg='Error: Invalid non-hex (test) minimum chain work value specified',
)
if __name__ == '__main__':
MinimumChainWorkTest().main()