value in messages

This commit is contained in:
Marek Kotewicz 2014-10-14 17:03:13 +02:00
parent 2606cf2b14
commit 7a65f94db9

View File

@ -3,6 +3,7 @@
#if ETH_JSONRPC && 1
#include <boost/test/unit_test.hpp>
#include <boost/lexical_cast.hpp>
#include <libdevcore/Log.h>
#include <libdevcore/CommonIO.h>
#include <libdevcore/CommonJS.h>
@ -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)