aboutsummaryrefslogtreecommitdiffstats
path: root/jsonrpc.cpp
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2014-10-14 23:03:13 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2014-10-14 23:03:13 +0800
commit7a65f94db922e91d5c53035895d94355013e6068 (patch)
tree8d422c465a58bc06c3de8017a926bf9fd5b3ac80 /jsonrpc.cpp
parent2606cf2b14c9e95888047c74c97aa4bf7de558a7 (diff)
downloaddexon-solidity-7a65f94db922e91d5c53035895d94355013e6068.tar
dexon-solidity-7a65f94db922e91d5c53035895d94355013e6068.tar.gz
dexon-solidity-7a65f94db922e91d5c53035895d94355013e6068.tar.bz2
dexon-solidity-7a65f94db922e91d5c53035895d94355013e6068.tar.lz
dexon-solidity-7a65f94db922e91d5c53035895d94355013e6068.tar.xz
dexon-solidity-7a65f94db922e91d5c53035895d94355013e6068.tar.zst
dexon-solidity-7a65f94db922e91d5c53035895d94355013e6068.zip
value in messages
Diffstat (limited to 'jsonrpc.cpp')
-rw-r--r--jsonrpc.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/jsonrpc.cpp b/jsonrpc.cpp
index 80354bc3..1e262d5c 100644
--- a/jsonrpc.cpp
+++ b/jsonrpc.cpp
@@ -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)