wallet: return and display signer error

Both RPC and GUI now render a useful error message instead of (silently) failing.

Replace bool with util::Result<void> to clarify that this either succeeds or returns an error message.
This commit is contained in:
Sjors Provoost
2024-02-13 13:25:59 +01:00
parent dc55531087
commit 4357158c47
12 changed files with 41 additions and 23 deletions

View File

@ -141,6 +141,13 @@ class WalletSignerTest(BitcoinTestFramework):
)
self.clear_mock_result(self.nodes[1])
# Returned address MUST match:
address_fail = hww.getnewaddress(address_type="bech32")
assert_equal(address_fail, "bcrt1ql7zg7ukh3dwr25ex2zn9jse926f27xy2jz58tm")
assert_raises_rpc_error(-1, 'Signer echoed unexpected address wrong_address',
hww.walletdisplayaddress, address_fail
)
self.log.info('Prepare mock PSBT')
self.nodes[0].sendtoaddress(address4, 1)
self.generate(self.nodes[0], 1)