diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-03-31 10:55:06 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-03-31 10:55:15 +0200 |
| commit | 16555b658f5b98fd5e0102bd3618659588fe8d0b (patch) | |
| tree | 8cf3ced27bcf464c2113436aadb718769b44337b /src/test | |
| parent | Merge #7648: BIP9 versionbits softfork for BIP68, BIP112 and BIP113 (diff) | |
| parent | rpc: Register calls where they are defined (diff) | |
| download | discoin-16555b658f5b98fd5e0102bd3618659588fe8d0b.tar.xz discoin-16555b658f5b98fd5e0102bd3618659588fe8d0b.zip | |
Merge #7766: rpc: Register calls where they are defined
fb8a8cf rpc: Register calls where they are defined (Wladimir J. van der Laan)
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rpc_tests.cpp | 2 | ||||
| -rw-r--r-- | src/test/test_bitcoin.cpp | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp index d6309ca38..1976ee2cb 100644 --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -36,7 +36,7 @@ UniValue CallRPC(string args) string strMethod = vArgs[0]; vArgs.erase(vArgs.begin()); UniValue params = RPCConvertValues(strMethod, vArgs); - + BOOST_CHECK(tableRPC[strMethod]); rpcfn_type method = tableRPC[strMethod]->actor; try { UniValue result = (*method)(params, false); diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index dadc8b948..1f2e034b0 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -17,6 +17,8 @@ #include "txdb.h" #include "txmempool.h" #include "ui_interface.h" +#include "rpc/server.h" +#include "rpc/register.h" #ifdef ENABLE_WALLET #include "wallet/db.h" #include "wallet/wallet.h" @@ -53,9 +55,12 @@ BasicTestingSetup::~BasicTestingSetup() TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(chainName) { const CChainParams& chainparams = Params(); + // Ideally we'd move all the RPC tests to the functional testing framework + // instead of unit tests, but for now we need these here. + RegisterAllCoreRPCCommands(tableRPC); #ifdef ENABLE_WALLET bitdb.MakeMock(); - walletRegisterRPCCommands(); + RegisterWalletRPCCommands(tableRPC); #endif ClearDatadirCache(); pathTemp = GetTempPath() / strprintf("test_bitcoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000))); |