Merge bitcoin/bitcoin#25093: doc: Fix incorrect sendmany RPC doc

fa95f2033a26fb18914c2aa5e5e18650d32e6e4b doc: Fix incorrect sendmany RPC doc (MarcoFalke)
fa96f93f056efffe3de5e5141f0e0927f8eb0abd 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 fa95f2033a26fb18914c2aa5e5e18650d32e6e4b

Tree-SHA512: 6f9992786472d3927485a34e918db76824cfb60fa96f42cc9c3cdba7074fe08c657bd77cb3e748432161a290f2dcf90bb0ece279904bd274c529119e65fa0959
This commit is contained in:
fanquake 2023-01-17 15:19:07 +00:00
commit ccd3d8d2c0
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1
2 changed files with 9 additions and 6 deletions

View File

@ -314,12 +314,11 @@ RPCHelpMan sendtoaddress()
RPCHelpMan sendmany()
{
return RPCHelpMan{"sendmany",
"\nSend multiple times. Amounts are double-precision floating point numbers." +
"Send multiple times. Amounts are double-precision floating point numbers." +
HELP_REQUIRING_PASSPHRASE,
{
{"dummy", RPCArg::Type::STR, RPCArg::Optional::NO, "Must be set to \"\" for backwards compatibility.",
{"dummy", RPCArg::Type::STR, RPCArg::Default{"\"\""}, "Must be set to \"\" for backwards compatibility.",
RPCArgOptions{
.skip_type_check = true,
.oneline_description = "\"\"",
}},
{"amounts", RPCArg::Type::OBJ_USER_KEYS, RPCArg::Optional::NO, "The addresses and amounts",

View File

@ -95,15 +95,19 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework):
self.check_invalid(INVALID_ADDRESS, 'Not a valid Bech32 or Base58 encoding')
self.check_invalid(INVALID_ADDRESS_2, 'Not a valid Bech32 or Base58 encoding')
node = self.nodes[0]
# Missing arg returns the help text
assert_raises_rpc_error(-1, "Return information about the given bitcoin address.", node.validateaddress)
# Explicit None is not allowed for required parameters
assert_raises_rpc_error(-3, "JSON value of type null is not of expected type string", node.validateaddress, None)
def test_getaddressinfo(self):
node = self.nodes[0]
assert_raises_rpc_error(-5, "Invalid Bech32 address data size", node.getaddressinfo, BECH32_INVALID_SIZE)
assert_raises_rpc_error(-5, "Not a valid Bech32 or Base58 encoding", node.getaddressinfo, BECH32_INVALID_PREFIX)
assert_raises_rpc_error(-5, "Invalid prefix for Base58-encoded address", node.getaddressinfo, BASE58_INVALID_PREFIX)
assert_raises_rpc_error(-5, "Not a valid Bech32 or Base58 encoding", node.getaddressinfo, INVALID_ADDRESS)
def run_test(self):