rpc: Assert that RPCArg names are equal to CRPCCommand ones (rpcdump)

This commit is contained in:
MarcoFalke 2020-08-14 11:22:05 +02:00
parent fa32c1d5ec
commit fa3d9ce325
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
3 changed files with 83 additions and 61 deletions

View file

@ -90,9 +90,9 @@ static void RescanWallet(CWallet& wallet, const WalletRescanReserver& reserver,
} }
} }
UniValue importprivkey(const JSONRPCRequest& request) RPCHelpMan importprivkey()
{ {
RPCHelpMan{"importprivkey", return RPCHelpMan{"importprivkey",
"\nAdds a private key (as returned by dumpprivkey) to your wallet. Requires a new wallet backup.\n" "\nAdds a private key (as returned by dumpprivkey) to your wallet. Requires a new wallet backup.\n"
"Hint: use importmulti to import more than one private key.\n" "Hint: use importmulti to import more than one private key.\n"
"\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n" "\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n"
@ -116,8 +116,8 @@ UniValue importprivkey(const JSONRPCRequest& request)
"\nAs a JSON-RPC call\n" "\nAs a JSON-RPC call\n"
+ HelpExampleRpc("importprivkey", "\"mykey\", \"testing\", false") + HelpExampleRpc("importprivkey", "\"mykey\", \"testing\", false")
}, },
}.Check(request); [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);
if (!wallet) return NullUniValue; if (!wallet) return NullUniValue;
CWallet* const pwallet = wallet.get(); CWallet* const pwallet = wallet.get();
@ -189,11 +189,13 @@ UniValue importprivkey(const JSONRPCRequest& request)
} }
return NullUniValue; return NullUniValue;
},
};
} }
UniValue abortrescan(const JSONRPCRequest& request) RPCHelpMan abortrescan()
{ {
RPCHelpMan{"abortrescan", return RPCHelpMan{"abortrescan",
"\nStops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call.\n" "\nStops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call.\n"
"Note: Use \"getwalletinfo\" to query the scanning progress.\n", "Note: Use \"getwalletinfo\" to query the scanning progress.\n",
{}, {},
@ -206,8 +208,8 @@ UniValue abortrescan(const JSONRPCRequest& request)
"\nAs a JSON-RPC call\n" "\nAs a JSON-RPC call\n"
+ HelpExampleRpc("abortrescan", "") + HelpExampleRpc("abortrescan", "")
}, },
}.Check(request); [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);
if (!wallet) return NullUniValue; if (!wallet) return NullUniValue;
CWallet* const pwallet = wallet.get(); CWallet* const pwallet = wallet.get();
@ -215,11 +217,13 @@ UniValue abortrescan(const JSONRPCRequest& request)
if (!pwallet->IsScanning() || pwallet->IsAbortingRescan()) return false; if (!pwallet->IsScanning() || pwallet->IsAbortingRescan()) return false;
pwallet->AbortRescan(); pwallet->AbortRescan();
return true; return true;
},
};
} }
UniValue importaddress(const JSONRPCRequest& request) RPCHelpMan importaddress()
{ {
RPCHelpMan{"importaddress", return RPCHelpMan{"importaddress",
"\nAdds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.\n" "\nAdds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.\n"
"\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n" "\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n"
"may report that the imported address exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\n" "may report that the imported address exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\n"
@ -243,8 +247,8 @@ UniValue importaddress(const JSONRPCRequest& request)
"\nAs a JSON-RPC call\n" "\nAs a JSON-RPC call\n"
+ HelpExampleRpc("importaddress", "\"myaddress\", \"testing\", false") + HelpExampleRpc("importaddress", "\"myaddress\", \"testing\", false")
}, },
}.Check(request); [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);
if (!wallet) return NullUniValue; if (!wallet) return NullUniValue;
CWallet* const pwallet = wallet.get(); CWallet* const pwallet = wallet.get();
@ -315,11 +319,13 @@ UniValue importaddress(const JSONRPCRequest& request)
} }
return NullUniValue; return NullUniValue;
},
};
} }
UniValue importprunedfunds(const JSONRPCRequest& request) RPCHelpMan importprunedfunds()
{ {
RPCHelpMan{"importprunedfunds", return RPCHelpMan{"importprunedfunds",
"\nImports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.\n", "\nImports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.\n",
{ {
{"rawtransaction", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "A raw transaction in hex funding an already-existing address in wallet"}, {"rawtransaction", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "A raw transaction in hex funding an already-existing address in wallet"},
@ -327,8 +333,8 @@ UniValue importprunedfunds(const JSONRPCRequest& request)
}, },
RPCResult{RPCResult::Type::NONE, "", ""}, RPCResult{RPCResult::Type::NONE, "", ""},
RPCExamples{""}, RPCExamples{""},
}.Check(request); [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);
if (!wallet) return NullUniValue; if (!wallet) return NullUniValue;
CWallet* const pwallet = wallet.get(); CWallet* const pwallet = wallet.get();
@ -371,11 +377,13 @@ UniValue importprunedfunds(const JSONRPCRequest& request)
} }
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No addresses in wallet correspond to included transaction"); throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No addresses in wallet correspond to included transaction");
},
};
} }
UniValue removeprunedfunds(const JSONRPCRequest& request) RPCHelpMan removeprunedfunds()
{ {
RPCHelpMan{"removeprunedfunds", return RPCHelpMan{"removeprunedfunds",
"\nDeletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances.\n", "\nDeletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances.\n",
{ {
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex-encoded id of the transaction you are deleting"}, {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex-encoded id of the transaction you are deleting"},
@ -386,8 +394,8 @@ UniValue removeprunedfunds(const JSONRPCRequest& request)
"\nAs a JSON-RPC call\n" "\nAs a JSON-RPC call\n"
+ HelpExampleRpc("removeprunedfunds", "\"a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5\"") + HelpExampleRpc("removeprunedfunds", "\"a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5\"")
}, },
}.Check(request); [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);
if (!wallet) return NullUniValue; if (!wallet) return NullUniValue;
CWallet* const pwallet = wallet.get(); CWallet* const pwallet = wallet.get();
@ -408,11 +416,13 @@ UniValue removeprunedfunds(const JSONRPCRequest& request)
} }
return NullUniValue; return NullUniValue;
},
};
} }
UniValue importpubkey(const JSONRPCRequest& request) RPCHelpMan importpubkey()
{ {
RPCHelpMan{"importpubkey", return RPCHelpMan{"importpubkey",
"\nAdds a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.\n" "\nAdds a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.\n"
"Hint: use importmulti to import more than one public key.\n" "Hint: use importmulti to import more than one public key.\n"
"\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n" "\nNote: This call can take over an hour to complete if rescan is true, during that time, other rpc calls\n"
@ -432,8 +442,8 @@ UniValue importpubkey(const JSONRPCRequest& request)
"\nAs a JSON-RPC call\n" "\nAs a JSON-RPC call\n"
+ HelpExampleRpc("importpubkey", "\"mypubkey\", \"testing\", false") + HelpExampleRpc("importpubkey", "\"mypubkey\", \"testing\", false")
}, },
}.Check(request); [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);
if (!wallet) return NullUniValue; if (!wallet) return NullUniValue;
CWallet* const pwallet = wallet.get(); CWallet* const pwallet = wallet.get();
@ -492,12 +502,14 @@ UniValue importpubkey(const JSONRPCRequest& request)
} }
return NullUniValue; return NullUniValue;
},
};
} }
UniValue importwallet(const JSONRPCRequest& request) RPCHelpMan importwallet()
{ {
RPCHelpMan{"importwallet", return RPCHelpMan{"importwallet",
"\nImports keys from a wallet dump file (see dumpwallet). Requires a new wallet backup to include imported keys.\n" "\nImports keys from a wallet dump file (see dumpwallet). Requires a new wallet backup to include imported keys.\n"
"Note: Use \"getwalletinfo\" to query the scanning progress.\n", "Note: Use \"getwalletinfo\" to query the scanning progress.\n",
{ {
@ -512,8 +524,8 @@ UniValue importwallet(const JSONRPCRequest& request)
"\nImport using the json rpc call\n" "\nImport using the json rpc call\n"
+ HelpExampleRpc("importwallet", "\"test\"") + HelpExampleRpc("importwallet", "\"test\"")
}, },
}.Check(request); [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);
if (!wallet) return NullUniValue; if (!wallet) return NullUniValue;
CWallet* const pwallet = wallet.get(); CWallet* const pwallet = wallet.get();
@ -649,11 +661,13 @@ UniValue importwallet(const JSONRPCRequest& request)
throw JSONRPCError(RPC_WALLET_ERROR, "Error adding some keys/scripts to wallet"); throw JSONRPCError(RPC_WALLET_ERROR, "Error adding some keys/scripts to wallet");
return NullUniValue; return NullUniValue;
},
};
} }
UniValue dumpprivkey(const JSONRPCRequest& request) RPCHelpMan dumpprivkey()
{ {
RPCHelpMan{"dumpprivkey", return RPCHelpMan{"dumpprivkey",
"\nReveals the private key corresponding to 'address'.\n" "\nReveals the private key corresponding to 'address'.\n"
"Then the importprivkey can be used with this output\n", "Then the importprivkey can be used with this output\n",
{ {
@ -667,8 +681,8 @@ UniValue dumpprivkey(const JSONRPCRequest& request)
+ HelpExampleCli("importprivkey", "\"mykey\"") + HelpExampleCli("importprivkey", "\"mykey\"")
+ HelpExampleRpc("dumpprivkey", "\"myaddress\"") + HelpExampleRpc("dumpprivkey", "\"myaddress\"")
}, },
}.Check(request); [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);
if (!wallet) return NullUniValue; if (!wallet) return NullUniValue;
const CWallet* const pwallet = wallet.get(); const CWallet* const pwallet = wallet.get();
@ -693,12 +707,14 @@ UniValue dumpprivkey(const JSONRPCRequest& request)
throw JSONRPCError(RPC_WALLET_ERROR, "Private key for address " + strAddress + " is not known"); throw JSONRPCError(RPC_WALLET_ERROR, "Private key for address " + strAddress + " is not known");
} }
return EncodeSecret(vchSecret); return EncodeSecret(vchSecret);
},
};
} }
UniValue dumpwallet(const JSONRPCRequest& request) RPCHelpMan dumpwallet()
{ {
RPCHelpMan{"dumpwallet", return RPCHelpMan{"dumpwallet",
"\nDumps all wallet keys in a human-readable format to a server-side file. This does not allow overwriting existing files.\n" "\nDumps all wallet keys in a human-readable format to a server-side file. This does not allow overwriting existing files.\n"
"Imported scripts are included in the dumpfile, but corresponding BIP173 addresses, etc. may not be added automatically by importwallet.\n" "Imported scripts are included in the dumpfile, but corresponding BIP173 addresses, etc. may not be added automatically by importwallet.\n"
"Note that if your wallet contains keys which are not derived from your HD seed (e.g. imported keys), these are not covered by\n" "Note that if your wallet contains keys which are not derived from your HD seed (e.g. imported keys), these are not covered by\n"
@ -716,8 +732,8 @@ UniValue dumpwallet(const JSONRPCRequest& request)
HelpExampleCli("dumpwallet", "\"test\"") HelpExampleCli("dumpwallet", "\"test\"")
+ HelpExampleRpc("dumpwallet", "\"test\"") + HelpExampleRpc("dumpwallet", "\"test\"")
}, },
}.Check(request); [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request); std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
if (!pwallet) return NullUniValue; if (!pwallet) return NullUniValue;
@ -829,6 +845,8 @@ UniValue dumpwallet(const JSONRPCRequest& request)
reply.pushKV("filename", filepath.string()); reply.pushKV("filename", filepath.string());
return reply; return reply;
},
};
} }
struct ImportData struct ImportData
@ -1239,9 +1257,9 @@ static int64_t GetImportTimestamp(const UniValue& data, int64_t now)
throw JSONRPCError(RPC_TYPE_ERROR, "Missing required timestamp field for key"); throw JSONRPCError(RPC_TYPE_ERROR, "Missing required timestamp field for key");
} }
UniValue importmulti(const JSONRPCRequest& mainRequest) RPCHelpMan importmulti()
{ {
RPCHelpMan{"importmulti", return RPCHelpMan{"importmulti",
"\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), optionally rescanning the blockchain from the earliest creation time of the imported scripts. Requires a new wallet backup.\n" "\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), optionally rescanning the blockchain from the earliest creation time of the imported scripts. Requires a new wallet backup.\n"
"If an address/script is imported without all of the private keys required to spend from that address, it will be watchonly. The 'watchonly' option must be set to true in this case or a warning will be returned.\n" "If an address/script is imported without all of the private keys required to spend from that address, it will be watchonly. The 'watchonly' option must be set to true in this case or a warning will be returned.\n"
"Conversely, if all the private keys are provided and the address/script is spendable, the watchonly option must be set to false, or a warning will be returned.\n" "Conversely, if all the private keys are provided and the address/script is spendable, the watchonly option must be set to false, or a warning will be returned.\n"
@ -1314,8 +1332,8 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
"{ \"scriptPubKey\": { \"address\": \"<my 2nd address>\" }, \"label\": \"example 2\", \"timestamp\": 1455191480 }]'") + "{ \"scriptPubKey\": { \"address\": \"<my 2nd address>\" }, \"label\": \"example 2\", \"timestamp\": 1455191480 }]'") +
HelpExampleCli("importmulti", "'[{ \"scriptPubKey\": { \"address\": \"<my address>\" }, \"timestamp\":1455191478 }]' '{ \"rescan\": false}'") HelpExampleCli("importmulti", "'[{ \"scriptPubKey\": { \"address\": \"<my address>\" }, \"timestamp\":1455191478 }]' '{ \"rescan\": false}'")
}, },
}.Check(mainRequest); [&](const RPCHelpMan& self, const JSONRPCRequest& mainRequest) -> UniValue
{
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(mainRequest); std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(mainRequest);
if (!wallet) return NullUniValue; if (!wallet) return NullUniValue;
CWallet* const pwallet = wallet.get(); CWallet* const pwallet = wallet.get();
@ -1423,6 +1441,8 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
} }
return response; return response;
},
};
} }
static UniValue ProcessDescriptorImport(CWallet * const pwallet, const UniValue& data, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet) static UniValue ProcessDescriptorImport(CWallet * const pwallet, const UniValue& data, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)
@ -1564,9 +1584,9 @@ static UniValue ProcessDescriptorImport(CWallet * const pwallet, const UniValue&
return result; return result;
} }
UniValue importdescriptors(const JSONRPCRequest& main_request) RPCHelpMan importdescriptors()
{ {
RPCHelpMan{"importdescriptors", return RPCHelpMan{"importdescriptors",
"\nImport descriptors. This will trigger a rescan of the blockchain based on the earliest timestamp of all descriptors being imported. Requires a new wallet backup.\n" "\nImport descriptors. This will trigger a rescan of the blockchain based on the earliest timestamp of all descriptors being imported. Requires a new wallet backup.\n"
"\nNote: This call can take over an hour to complete if using an early timestamp; during that time, other rpc calls\n" "\nNote: This call can take over an hour to complete if using an early timestamp; during that time, other rpc calls\n"
"may report that the imported keys, addresses or scripts exist but related transactions are still missing.\n", "may report that the imported keys, addresses or scripts exist but related transactions are still missing.\n",
@ -1615,8 +1635,8 @@ UniValue importdescriptors(const JSONRPCRequest& main_request)
"{ \"desc\": \"<my desccriptor 2>\", \"label\": \"example 2\", \"timestamp\": 1455191480 }]'") + "{ \"desc\": \"<my desccriptor 2>\", \"label\": \"example 2\", \"timestamp\": 1455191480 }]'") +
HelpExampleCli("importdescriptors", "'[{ \"desc\": \"<my descriptor>\", \"timestamp\":1455191478, \"active\": true, \"range\": [0,100], \"label\": \"<my bech32 wallet>\" }]'") HelpExampleCli("importdescriptors", "'[{ \"desc\": \"<my descriptor>\", \"timestamp\":1455191478, \"active\": true, \"range\": [0,100], \"label\": \"<my bech32 wallet>\" }]'")
}, },
}.Check(main_request); [&](const RPCHelpMan& self, const JSONRPCRequest& main_request) -> UniValue
{
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(main_request); std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(main_request);
if (!wallet) return NullUniValue; if (!wallet) return NullUniValue;
CWallet* const pwallet = wallet.get(); CWallet* const pwallet = wallet.get();
@ -1713,4 +1733,6 @@ UniValue importdescriptors(const JSONRPCRequest& main_request)
} }
return response; return response;
},
};
} }

View file

@ -4133,17 +4133,17 @@ static UniValue upgradewallet(const JSONRPCRequest& request)
return error.original; return error.original;
} }
UniValue abortrescan(const JSONRPCRequest& request); // in rpcdump.cpp RPCHelpMan abortrescan();
UniValue dumpprivkey(const JSONRPCRequest& request); // in rpcdump.cpp RPCHelpMan dumpprivkey();
UniValue importprivkey(const JSONRPCRequest& request); RPCHelpMan importprivkey();
UniValue importaddress(const JSONRPCRequest& request); RPCHelpMan importaddress();
UniValue importpubkey(const JSONRPCRequest& request); RPCHelpMan importpubkey();
UniValue dumpwallet(const JSONRPCRequest& request); RPCHelpMan dumpwallet();
UniValue importwallet(const JSONRPCRequest& request); RPCHelpMan importwallet();
UniValue importprunedfunds(const JSONRPCRequest& request); RPCHelpMan importprunedfunds();
UniValue removeprunedfunds(const JSONRPCRequest& request); RPCHelpMan removeprunedfunds();
UniValue importmulti(const JSONRPCRequest& request); RPCHelpMan importmulti();
UniValue importdescriptors(const JSONRPCRequest& request); RPCHelpMan importdescriptors();
Span<const CRPCCommand> GetWalletRPCCommands() Span<const CRPCCommand> GetWalletRPCCommands()
{ {

View file

@ -24,9 +24,9 @@
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include <univalue.h> #include <univalue.h>
extern UniValue importmulti(const JSONRPCRequest& request); RPCHelpMan importmulti();
extern UniValue dumpwallet(const JSONRPCRequest& request); RPCHelpMan dumpwallet();
extern UniValue importwallet(const JSONRPCRequest& request); RPCHelpMan importwallet();
// Ensure that fee levels defined in the wallet are at least as high // Ensure that fee levels defined in the wallet are at least as high
// as the default levels for node policy. // as the default levels for node policy.
@ -219,7 +219,7 @@ BOOST_FIXTURE_TEST_CASE(importmulti_rescan, TestChain100Setup)
request.params.setArray(); request.params.setArray();
request.params.push_back(keys); request.params.push_back(keys);
UniValue response = importmulti(request); UniValue response = importmulti().HandleRequest(request);
BOOST_CHECK_EQUAL(response.write(), BOOST_CHECK_EQUAL(response.write(),
strprintf("[{\"success\":false,\"error\":{\"code\":-1,\"message\":\"Rescan failed for key with creation " strprintf("[{\"success\":false,\"error\":{\"code\":-1,\"message\":\"Rescan failed for key with creation "
"timestamp %d. There was an error reading a block from time %d, which is after or within %d " "timestamp %d. There was an error reading a block from time %d, which is after or within %d "
@ -274,7 +274,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
request.params.setArray(); request.params.setArray();
request.params.push_back(backup_file); request.params.push_back(backup_file);
::dumpwallet(request); ::dumpwallet().HandleRequest(request);
RemoveWallet(wallet); RemoveWallet(wallet);
} }
@ -291,7 +291,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
request.params.push_back(backup_file); request.params.push_back(backup_file);
AddWallet(wallet); AddWallet(wallet);
wallet->SetLastBlockProcessed(::ChainActive().Height(), ::ChainActive().Tip()->GetBlockHash()); wallet->SetLastBlockProcessed(::ChainActive().Height(), ::ChainActive().Tip()->GetBlockHash());
::importwallet(request); ::importwallet().HandleRequest(request);
RemoveWallet(wallet); RemoveWallet(wallet);
BOOST_CHECK_EQUAL(wallet->mapWallet.size(), 3U); BOOST_CHECK_EQUAL(wallet->mapWallet.size(), 3U);