Skip to content

Commit ccd3d8d

Browse files
committed
Merge bitcoin/bitcoin#25093: doc: Fix incorrect sendmany RPC doc
fa95f20 doc: Fix incorrect sendmany RPC doc (MarcoFalke) fa96f93 test: Add test for missing and omitted required arg (MarcoFalke) Pull request description: This enables the skipped type check for `sendmany` and fixes the resulting error. Also, there is an unrelated test-only commit. ACKs for top commit: fanquake: ACK fa95f20 Tree-SHA512: 6f9992786472d3927485a34e918db76824cfb60fa96f42cc9c3cdba7074fe08c657bd77cb3e748432161a290f2dcf90bb0ece279904bd274c529119e65fa0959
2 parents 635f190 + fa95f20 commit ccd3d8d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/wallet/rpc/spend.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,11 @@ RPCHelpMan sendtoaddress()
314314
RPCHelpMan sendmany()
315315
{
316316
return RPCHelpMan{"sendmany",
317-
"\nSend multiple times. Amounts are double-precision floating point numbers." +
317+
"Send multiple times. Amounts are double-precision floating point numbers." +
318318
HELP_REQUIRING_PASSPHRASE,
319319
{
320-
{"dummy", RPCArg::Type::STR, RPCArg::Optional::NO, "Must be set to \"\" for backwards compatibility.",
320+
{"dummy", RPCArg::Type::STR, RPCArg::Default{"\"\""}, "Must be set to \"\" for backwards compatibility.",
321321
RPCArgOptions{
322-
.skip_type_check = true,
323322
.oneline_description = "\"\"",
324323
}},
325324
{"amounts", RPCArg::Type::OBJ_USER_KEYS, RPCArg::Optional::NO, "The addresses and amounts",

test/functional/rpc_invalid_address_message.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,19 @@ def test_validateaddress(self):
9595
self.check_invalid(INVALID_ADDRESS, 'Not a valid Bech32 or Base58 encoding')
9696
self.check_invalid(INVALID_ADDRESS_2, 'Not a valid Bech32 or Base58 encoding')
9797

98+
node = self.nodes[0]
99+
100+
# Missing arg returns the help text
101+
assert_raises_rpc_error(-1, "Return information about the given bitcoin address.", node.validateaddress)
102+
# Explicit None is not allowed for required parameters
103+
assert_raises_rpc_error(-3, "JSON value of type null is not of expected type string", node.validateaddress, None)
104+
98105
def test_getaddressinfo(self):
99106
node = self.nodes[0]
100107

101108
assert_raises_rpc_error(-5, "Invalid Bech32 address data size", node.getaddressinfo, BECH32_INVALID_SIZE)
102-
103109
assert_raises_rpc_error(-5, "Not a valid Bech32 or Base58 encoding", node.getaddressinfo, BECH32_INVALID_PREFIX)
104-
105110
assert_raises_rpc_error(-5, "Invalid prefix for Base58-encoded address", node.getaddressinfo, BASE58_INVALID_PREFIX)
106-
107111
assert_raises_rpc_error(-5, "Not a valid Bech32 or Base58 encoding", node.getaddressinfo, INVALID_ADDRESS)
108112

109113
def run_test(self):

0 commit comments

Comments
 (0)