aboutsummaryrefslogtreecommitdiffstats
path: root/test/RPCSession.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-02-07 20:35:27 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-02-09 05:24:29 +0800
commitf9357dbb22de8690940d605fc72ef6df4deb7f6b (patch)
tree95ffd3335ba1f22d9d05bdc082830bda12abd91e /test/RPCSession.cpp
parent3be6d105252d2153a6c05a4e788f615ed0921d6b (diff)
downloaddexon-solidity-f9357dbb22de8690940d605fc72ef6df4deb7f6b.tar
dexon-solidity-f9357dbb22de8690940d605fc72ef6df4deb7f6b.tar.gz
dexon-solidity-f9357dbb22de8690940d605fc72ef6df4deb7f6b.tar.bz2
dexon-solidity-f9357dbb22de8690940d605fc72ef6df4deb7f6b.tar.lz
dexon-solidity-f9357dbb22de8690940d605fc72ef6df4deb7f6b.tar.xz
dexon-solidity-f9357dbb22de8690940d605fc72ef6df4deb7f6b.tar.zst
dexon-solidity-f9357dbb22de8690940d605fc72ef6df4deb7f6b.zip
Check the return value of RPC calls
Diffstat (limited to 'test/RPCSession.cpp')
-rw-r--r--test/RPCSession.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/RPCSession.cpp b/test/RPCSession.cpp
index 43f10824..ffdb48b1 100644
--- a/test/RPCSession.cpp
+++ b/test/RPCSession.cpp
@@ -111,7 +111,9 @@ string IPCSocket::sendRequest(string const& _req)
if (!fSuccess)
BOOST_FAIL("ReadFile from pipe failed");
- cerr << "."; //Output for log activity
+ // This is needed for Appveyor, otherwise it may terminate
+ // the session due to the inactivity.
+ cerr << ".";
return returnStr;
#else
send(m_socket, _req.c_str(), _req.length(), 0);
@@ -189,7 +191,7 @@ string RPCSession::eth_getStorageRoot(string const& _address, string const& _blo
void RPCSession::personal_unlockAccount(string const& _address, string const& _password, int _duration)
{
- rpcCall("personal_unlockAccount", { quote(_address), quote(_password), to_string(_duration) });
+ BOOST_CHECK(rpcCall("personal_unlockAccount", { quote(_address), quote(_password), to_string(_duration) }) == true);
}
string RPCSession::personal_newAccount(string const& _password)
@@ -233,18 +235,18 @@ void RPCSession::test_setChainParams(vector<string> const& _accounts)
void RPCSession::test_setChainParams(string const& _config)
{
- rpcCall("test_setChainParams", { _config });
+ BOOST_CHECK(rpcCall("test_setChainParams", { _config }) == true);
}
void RPCSession::test_rewindToBlock(size_t _blockNr)
{
- rpcCall("test_rewindToBlock", { to_string(_blockNr) });
+ BOOST_CHECK(rpcCall("test_rewindToBlock", { to_string(_blockNr) }) == true);
}
void RPCSession::test_mineBlocks(int _number)
{
u256 startBlock = fromBigEndian<u256>(fromHex(rpcCall("eth_blockNumber").asString()));
- rpcCall("test_mineBlocks", { to_string(_number) }, true);
+ BOOST_CHECK(rpcCall("test_mineBlocks", { to_string(_number) }, true) == true);
bool mined = false;
@@ -283,7 +285,7 @@ void RPCSession::test_mineBlocks(int _number)
void RPCSession::test_modifyTimestamp(size_t _timestamp)
{
- rpcCall("test_modifyTimestamp", { to_string(_timestamp) });
+ BOOST_CHECK(rpcCall("test_modifyTimestamp", { to_string(_timestamp) }) == true);
}
Json::Value RPCSession::rpcCall(string const& _methodName, vector<string> const& _args, bool _canFail)