diff --git a/libethrpc/EthStubServer.cpp b/libethrpc/EthStubServer.cpp index f7083aa45..3eb3170e8 100644 --- a/libethrpc/EthStubServer.cpp +++ b/libethrpc/EthStubServer.cpp @@ -58,6 +58,7 @@ static Json::Value toJson(const dev::eth::PastMessage& t) res["output"] = jsFromBinary(t.output); res["to"] = toJS(t.to); res["from"] = toJS(t.from); + res["value"] = jsToDecimal(toJS(t.value)); res["origin"] = toJS(t.origin); res["timestamp"] = toJS(t.timestamp); res["coinbase"] = toJS(t.coinbase); diff --git a/test/jsonrpc.cpp b/test/jsonrpc.cpp index 80354bc33..1e262d5c5 100644 --- a/test/jsonrpc.cpp +++ b/test/jsonrpc.cpp @@ -3,6 +3,7 @@ #if ETH_JSONRPC && 1 #include +#include #include #include #include @@ -276,7 +277,7 @@ BOOST_AUTO_TEST_CASE(jsonrpc_transact) Json::Value t; t["from"] = toJS(key.secret()); - t["value"] = toJS(txAmount); + t["value"] = jsToDecimal(toJS(txAmount)); t["to"] = toJS(receiver.address()); t["data"] = toJS(bytes()); t["gas"] = toJS(gas); @@ -286,19 +287,19 @@ BOOST_AUTO_TEST_CASE(jsonrpc_transact) dev::eth::mine(*(web3.ethereum()), 1); auto balance2 = web3.ethereum()->balanceAt(receiver.address()); - auto number = web3.ethereum()->number(); + auto messages = jsonrpcClient->messages(Json::Value()); BOOST_REQUIRE(balance2 > 0); BOOST_CHECK_EQUAL(txAmount, balance2); - - // auto ax = jsToFixed(number); - // Json::Value p = jsonrpcClient->transaction(0, jsToFixed(number)); - // TODO, check transactions + BOOST_CHECK_EQUAL(txAmount, jsToU256(messages[0u]["value"].asString())); } BOOST_AUTO_TEST_CASE(jsonrpc_transaction) { - - + // TODO! not working? +// auto messages = jsonrpcClient->messages(Json::Value()); +// auto transactionNumber = messages[0u]["path"][0u].asInt(); +// auto transactionBlock = messages[0u]["block"].asString(); +// Json::Value p = jsonrpcClient->transaction(transactionNumber, transactionBlock); } BOOST_AUTO_TEST_CASE(jsonrpc_uncle)