Refactor Env for AbstractClient:

Env is changed to use the AbstractClient interface,
which generalizes the transport for submitting client
requests to the Env server instance.

The JSONRPCClient implementation is added, supporting
a simple, synchronous interface. Env is changed to
use the JSONRPCClient implementation instead of the
built in JSON-RPC client.
This commit is contained in:
Vinnie Falco
2016-01-25 18:27:40 -05:00
committed by Nik Bougalis
parent f9f2b8124d
commit 040d7ebb46
9 changed files with 349 additions and 51 deletions

View File

@@ -74,13 +74,11 @@ struct Transaction_ordering_test : public beast::unit_test::suite
{
auto const result = env.rpc("tx", to_string(tx1.stx->getTransactionID()));
expect(result.first == rpcSUCCESS);
expect(result.second["result"]["meta"]["TransactionResult"] == "tesSUCCESS");
expect(result["result"]["meta"]["TransactionResult"] == "tesSUCCESS");
}
{
auto const result = env.rpc("tx", to_string(tx2.stx->getTransactionID()));
expect(result.first == rpcSUCCESS);
expect(result.second["result"]["meta"]["TransactionResult"] == "tesSUCCESS");
expect(result["result"]["meta"]["TransactionResult"] == "tesSUCCESS");
}
}
@@ -112,13 +110,11 @@ struct Transaction_ordering_test : public beast::unit_test::suite
{
auto const result = env.rpc("tx", to_string(tx1.stx->getTransactionID()));
expect(result.first == rpcSUCCESS);
expect(result.second["result"]["meta"]["TransactionResult"] == "tesSUCCESS");
expect(result["result"]["meta"]["TransactionResult"] == "tesSUCCESS");
}
{
auto const result = env.rpc("tx", to_string(tx2.stx->getTransactionID()));
expect(result.first == rpcSUCCESS);
expect(result.second["result"]["meta"]["TransactionResult"] == "tesSUCCESS");
expect(result["result"]["meta"]["TransactionResult"] == "tesSUCCESS");
}
}
@@ -160,8 +156,7 @@ struct Transaction_ordering_test : public beast::unit_test::suite
for (auto i = 0; i < 5; ++i)
{
auto const result = env.rpc("tx", to_string(tx[i].stx->getTransactionID()));
expect(result.first == rpcSUCCESS);
expect(result.second["result"]["meta"]["TransactionResult"] == "tesSUCCESS");
expect(result["result"]["meta"]["TransactionResult"] == "tesSUCCESS");
}
}