fixed jsonrpc param types

This commit is contained in:
Marek Kotewicz 2014-10-14 13:13:30 +02:00
parent eb72beb7c3
commit 25d71c1167
2 changed files with 4 additions and 3 deletions

View File

@ -39,7 +39,7 @@ p["block"] = block;
p["numberOrHash"] = numberOrHash;
Json::Value result = this->client->CallMethod("block",p);
if (result.isArray())
if (result.isObject())
return result;
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
@ -374,7 +374,7 @@ p["s"] = s;
p["numberOrHash"] = numberOrHash;
Json::Value result = this->client->CallMethod("transaction",p);
if (result.isArray())
if (result.isObject())
return result;
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
@ -388,7 +388,7 @@ p["numberOrHash"] = numberOrHash;
p["numberOrHash"] = numberOrHash;
Json::Value result = this->client->CallMethod("uncle",p);
if (result.isArray())
if (result.isObject())
return result;
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());

View File

@ -256,6 +256,7 @@ BOOST_AUTO_TEST_CASE(jsonrpc_toFixed)
BOOST_AUTO_TEST_CASE(jsonrpc_transact)
{
cnote << "Testing jsonrpc transact...";
web3.ethereum()->setAddress(keys[0].address());
auto receiver = KeyPair::create();
dev::eth::mine(*(web3.ethereum()), 1);