0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

test: Use loop to register RPCs

The same loop is used by the server, so no need for
the tests to do this differently.
This commit is contained in:
MarcoFalke 2021-04-30 19:53:31 +02:00
parent b8593616dc
commit fa2197c8b3
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -35,14 +35,16 @@ static RPCHelpMan rpcNestedTest_rpc()
}
static const CRPCCommand vRPCCommands[] = {
{"test", &rpcNestedTest_rpc},
{"rpcNestedTest", &rpcNestedTest_rpc},
};
void RPCNestedTests::rpcNestedTests()
{
// do some test setup
// could be moved to a more generic place when we add more tests on QT level
tableRPC.appendCommand("rpcNestedTest", &vRPCCommands[0]);
for (const auto& c : vRPCCommands) {
tableRPC.appendCommand(c.name, &c);
}
TestingSetup test;
m_node.setContext(&test.m_node);