mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-27 20:49:30 +02:00
rpc, test: Fix error message in getdescriptoractivity
Mark blockhashes and scanobjects arguments as required, so the user receives a clear help message when either is missing. Added a new functional test for this use case. Co-authored-by: stickies-v <stickies-v@users.noreply.github.com>
This commit is contained in:
@@ -31,6 +31,7 @@ class GetBlocksActivityTest(BitcoinTestFramework):
|
||||
self.test_confirmed_and_unconfirmed(node, wallet)
|
||||
self.test_receive_then_spend(node, wallet)
|
||||
self.test_no_address(node, wallet)
|
||||
self.test_required_args(node)
|
||||
|
||||
def test_no_activity(self, node):
|
||||
self.log.info("Test that no activity is found for an unused address")
|
||||
@@ -231,6 +232,11 @@ class GetBlocksActivityTest(BitcoinTestFramework):
|
||||
assert_equal(list(a2['output_spk'].keys()), ['asm', 'desc', 'hex', 'type'])
|
||||
assert a2['amount'] == Decimal(no_addr_tx["tx"].vout[0].nValue) / COIN
|
||||
|
||||
def test_required_args(self, node):
|
||||
self.log.info("Test that required arguments must be passed")
|
||||
assert_raises_rpc_error(-1, "getdescriptoractivity", node.getdescriptoractivity)
|
||||
assert_raises_rpc_error(-1, "getdescriptoractivity", node.getdescriptoractivity, [])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
GetBlocksActivityTest(__file__).main()
|
||||
|
Reference in New Issue
Block a user