diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6aa99b618..a11c9fa16 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,8 +4,6 @@ aux_source_directory(. SRC_LIST)
list(REMOVE_ITEM SRC_LIST "./createRandomTest.cpp")
include_directories(..)
-link_directories(../libethcore)
-link_directories(../libethereum)
file(GLOB HEADERS "*.h")
add_executable(testeth ${SRC_LIST} ${HEADERS})
@@ -17,6 +15,10 @@ target_link_libraries(testeth secp256k1)
target_link_libraries(testeth gmp)
target_link_libraries(testeth solidity)
target_link_libraries(testeth ${CRYPTOPP_LS})
+target_link_libraries(testeth webthree)
+if(JSONRPC_LS)
+target_link_libraries(testeth web3jsonrpc)
+endif()
target_link_libraries(createRandomTest ethereum)
target_link_libraries(createRandomTest ethcore)
diff --git a/jsonrpc.cpp b/jsonrpc.cpp
new file mode 100644
index 000000000..033339ec2
--- /dev/null
+++ b/jsonrpc.cpp
@@ -0,0 +1,250 @@
+/*
+ This file is part of cpp-ethereum.
+
+ cpp-ethereum is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ cpp-ethereum is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpp-ethereum. If not, see .
+*/
+/** @file jsonrpc.cpp
+ * @author Marek Kotewicz
+ * @date 2014
+ */
+
+#if ETH_JSONRPC
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "JsonSpiritHeaders.h"
+#include "TestHelper.h"
+#include "webthreestubclient.h"
+
+BOOST_AUTO_TEST_SUITE(jsonrpc)
+
+using namespace std;
+using namespace dev;
+using namespace dev::eth;
+namespace js = json_spirit;
+
+namespace jsonrpc_tests
+{
+
+string name = "Ethereum(++) tests";
+string dbPath;
+auto s = set{"eth", "shh"};
+dev::p2p::NetworkPreferences np(30303, std::string(), false);
+dev::WebThreeDirect web3(name, dbPath, true, s, np);
+
+unique_ptr jsonrpcServer;
+unique_ptr jsonrpcClient;
+
+struct JsonrpcFixture {
+ JsonrpcFixture()
+ {
+ cnote << "setup jsonrpc";
+
+ web3.setIdealPeerCount(5);
+ web3.ethereum()->setForceMining(true);
+ jsonrpcServer = unique_ptr(new WebThreeStubServer(new jsonrpc::CorsHttpServer(8080), web3, {}));
+ jsonrpcServer->setIdentities({});
+ jsonrpcServer->StartListening();
+
+ jsonrpcClient = unique_ptr(new WebThreeStubClient(new jsonrpc::HttpClient("http://localhost:8080")));
+ }
+ ~JsonrpcFixture()
+ {
+ cnote << "teardown jsonrpc";
+ }
+};
+
+BOOST_GLOBAL_FIXTURE(JsonrpcFixture)
+
+BOOST_AUTO_TEST_CASE(jsonrpc_defaultBlock)
+{
+ cnote << "Testing jsonrpc defaultBlock...";
+ int defaultBlock = jsonrpcClient->defaultBlock();
+ BOOST_CHECK_EQUAL(defaultBlock, web3.ethereum()->getDefault());
+}
+
+BOOST_AUTO_TEST_CASE(jsonrpc_gasPrice)
+{
+ cnote << "Testing jsonrpc gasPrice...";
+ string gasPrice = jsonrpcClient->gasPrice();
+ BOOST_CHECK_EQUAL(gasPrice, toJS(10 * dev::eth::szabo));
+}
+
+BOOST_AUTO_TEST_CASE(jsonrpc_isListening)
+{
+ cnote << "Testing jsonrpc isListening...";
+
+ web3.startNetwork();
+ bool listeningOn = jsonrpcClient->listening();
+ BOOST_CHECK_EQUAL(listeningOn, web3.isNetworkStarted());
+
+ web3.stopNetwork();
+ bool listeningOff = jsonrpcClient->listening();
+ BOOST_CHECK_EQUAL(listeningOff, web3.isNetworkStarted());
+}
+
+BOOST_AUTO_TEST_CASE(jsonrpc_isMining)
+{
+ cnote << "Testing jsonrpc isMining...";
+
+ web3.ethereum()->startMining();
+ bool miningOn = jsonrpcClient->mining();
+ BOOST_CHECK_EQUAL(miningOn, web3.ethereum()->isMining());
+
+ web3.ethereum()->stopMining();
+ bool miningOff = jsonrpcClient->mining();
+ BOOST_CHECK_EQUAL(miningOff, web3.ethereum()->isMining());
+}
+
+BOOST_AUTO_TEST_CASE(jsonrpc_accounts)
+{
+ cnote << "Testing jsonrpc accounts...";
+ std::vector keys = {KeyPair::create(), KeyPair::create()};
+ jsonrpcServer->setAccounts(keys);
+ Json::Value k = jsonrpcClient->accounts();
+ jsonrpcServer->setAccounts({});
+ BOOST_CHECK_EQUAL(k.isArray(), true);
+ BOOST_CHECK_EQUAL(k.size(), keys.size());
+ for (auto &i:k)
+ {
+ auto it = std::find_if(keys.begin(), keys.end(), [i](dev::KeyPair const& keyPair)
+ {
+ return jsToAddress(i.asString()) == keyPair.address();
+ });
+ BOOST_CHECK_EQUAL(it != keys.end(), true);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(jsonrpc_number)
+{
+ cnote << "Testing jsonrpc number2...";
+ int number = jsonrpcClient->number();
+ BOOST_CHECK_EQUAL(number, web3.ethereum()->number() + 1);
+ dev::eth::mine(*(web3.ethereum()), 1);
+ int numberAfter = jsonrpcClient->number();
+ BOOST_CHECK_EQUAL(number + 1, numberAfter);
+ BOOST_CHECK_EQUAL(numberAfter, web3.ethereum()->number() + 1);
+}
+
+BOOST_AUTO_TEST_CASE(jsonrpc_peerCount)
+{
+ cnote << "Testing jsonrpc peerCount...";
+ int peerCount = jsonrpcClient->peerCount();
+ BOOST_CHECK_EQUAL(web3.peerCount(), peerCount);
+}
+
+BOOST_AUTO_TEST_CASE(jsonrpc_setListening)
+{
+ cnote << "Testing jsonrpc setListening...";
+
+ jsonrpcClient->setListening(true);
+ BOOST_CHECK_EQUAL(web3.isNetworkStarted(), true);
+
+ jsonrpcClient->setListening(false);
+ BOOST_CHECK_EQUAL(web3.isNetworkStarted(), false);
+}
+
+BOOST_AUTO_TEST_CASE(jsonrpc_setMining)
+{
+ cnote << "Testing jsonrpc setMining...";
+
+ jsonrpcClient->setMining(true);
+ BOOST_CHECK_EQUAL(web3.ethereum()->isMining(), true);
+
+ jsonrpcClient->setMining(false);
+ BOOST_CHECK_EQUAL(web3.ethereum()->isMining(), false);
+}
+
+BOOST_AUTO_TEST_CASE(jsonrpc_stateAt)
+{
+ cnote << "Testing jsonrpc stateAt...";
+ dev::KeyPair key = KeyPair::create();
+ auto address = key.address();
+ string stateAt = jsonrpcClient->stateAt(toJS(address), "0");
+ BOOST_CHECK_EQUAL(toJS(web3.ethereum()->stateAt(address, jsToU256("0"), 0)), stateAt);
+}
+
+BOOST_AUTO_TEST_CASE(jsonrpc_transact)
+{
+ cnote << "Testing jsonrpc transact...";
+ string coinbase = jsonrpcClient->coinbase();
+ BOOST_CHECK_EQUAL(jsToAddress(coinbase), web3.ethereum()->address());
+
+ dev::KeyPair key = KeyPair::create();
+ auto address = key.address();
+ auto receiver = KeyPair::create();
+ web3.ethereum()->setAddress(address);
+
+ coinbase = jsonrpcClient->coinbase();
+ BOOST_CHECK_EQUAL(jsToAddress(coinbase), web3.ethereum()->address());
+ BOOST_CHECK_EQUAL(jsToAddress(coinbase), address);
+
+ jsonrpcServer->setAccounts({key});
+ auto balance = web3.ethereum()->balanceAt(address, 0);
+ string balanceString = jsonrpcClient->balanceAt(toJS(address));
+ double countAt = jsonrpcClient->countAt(toJS(address));
+
+ BOOST_CHECK_EQUAL(countAt, (double)(uint64_t)web3.ethereum()->countAt(address));
+ BOOST_CHECK_EQUAL(countAt, 0);
+ BOOST_CHECK_EQUAL(toJS(balance), balanceString);
+ BOOST_CHECK_EQUAL(jsToDecimal(balanceString), "0");
+
+ dev::eth::mine(*(web3.ethereum()), 1);
+ balance = web3.ethereum()->balanceAt(address, 0);
+ balanceString = jsonrpcClient->balanceAt(toJS(address));
+
+ BOOST_CHECK_EQUAL(toJS(balance), balanceString);
+ BOOST_CHECK_EQUAL(jsToDecimal(balanceString), "1500000000000000000");
+
+ auto txAmount = balance / 2u;
+ auto gasPrice = 10 * dev::eth::szabo;
+ auto gas = dev::eth::c_txGas;
+
+ Json::Value t;
+ t["from"] = toJS(address);
+ t["value"] = jsToDecimal(toJS(txAmount));
+ t["to"] = toJS(receiver.address());
+ t["data"] = toJS(bytes());
+ t["gas"] = toJS(gas);
+ t["gasPrice"] = toJS(gasPrice);
+
+ jsonrpcClient->transact(t);
+ jsonrpcServer->setAccounts({});
+ dev::eth::mine(*(web3.ethereum()), 1);
+
+ countAt = jsonrpcClient->countAt(toJS(address));
+ auto balance2 = web3.ethereum()->balanceAt(receiver.address());
+ string balanceString2 = jsonrpcClient->balanceAt(toJS(receiver.address()));
+
+ BOOST_CHECK_EQUAL(countAt, (double)(uint64_t)web3.ethereum()->countAt(address));
+ BOOST_CHECK_EQUAL(countAt, 1);
+ BOOST_CHECK_EQUAL(toJS(balance2), balanceString2);
+ BOOST_CHECK_EQUAL(jsToDecimal(balanceString2), "750000000000000000");
+ BOOST_CHECK_EQUAL(txAmount, balance2);
+}
+
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+#endif
diff --git a/solidityCompiler.cpp b/solidityCompiler.cpp
new file mode 100644
index 000000000..e08605110
--- /dev/null
+++ b/solidityCompiler.cpp
@@ -0,0 +1,229 @@
+
+/*
+ This file is part of cpp-ethereum.
+
+ cpp-ethereum is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ cpp-ethereum is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with cpp-ethereum. If not, see .
+*/
+/**
+ * @author Christian
+ * @date 2014
+ * Unit tests for the name and type resolution of the solidity parser.
+ */
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace dev
+{
+namespace solidity
+{
+namespace test
+{
+
+namespace
+{
+
+/**
+ * Helper class that extracts the first expression in an AST.
+ */
+class FirstExpressionExtractor: private ASTVisitor
+{
+public:
+ FirstExpressionExtractor(ASTNode& _node): m_expression(nullptr) { _node.accept(*this); }
+ Expression* getExpression() const { return m_expression; }
+private:
+ virtual bool visit(Expression& _expression) override { return checkExpression(_expression); }
+ virtual bool visit(Assignment& _expression) override { return checkExpression(_expression); }
+ virtual bool visit(UnaryOperation& _expression) override { return checkExpression(_expression); }
+ virtual bool visit(BinaryOperation& _expression) override { return checkExpression(_expression); }
+ virtual bool visit(FunctionCall& _expression) override { return checkExpression(_expression); }
+ virtual bool visit(MemberAccess& _expression) override { return checkExpression(_expression); }
+ virtual bool visit(IndexAccess& _expression) override { return checkExpression(_expression); }
+ virtual bool visit(PrimaryExpression& _expression) override { return checkExpression(_expression); }
+ virtual bool visit(Identifier& _expression) override { return checkExpression(_expression); }
+ virtual bool visit(ElementaryTypeNameExpression& _expression) override { return checkExpression(_expression); }
+ virtual bool visit(Literal& _expression) override { return checkExpression(_expression); }
+ bool checkExpression(Expression& _expression)
+ {
+ if (m_expression == nullptr)
+ m_expression = &_expression;
+ return false;
+ }
+private:
+ Expression* m_expression;
+};
+
+bytes compileFirstExpression(std::string const& _sourceCode)
+{
+ Parser parser;
+ ASTPointer contract;
+ BOOST_REQUIRE_NO_THROW(contract = parser.parse(std::make_shared(CharStream(_sourceCode))));
+ NameAndTypeResolver resolver;
+ BOOST_REQUIRE_NO_THROW(resolver.resolveNamesAndTypes(*contract));
+ FirstExpressionExtractor extractor(*contract);
+ BOOST_REQUIRE(extractor.getExpression() != nullptr);
+
+ CompilerContext context;
+ ExpressionCompiler compiler(context);
+ compiler.compile(*extractor.getExpression());
+ bytes instructions = compiler.getAssembledBytecode();
+ // debug
+ //std::cout << eth::disassemble(instructions) << std::endl;
+ return instructions;
+}
+
+} // end anonymous namespace
+
+BOOST_AUTO_TEST_SUITE(SolidityExpressionCompiler)
+
+BOOST_AUTO_TEST_CASE(literal_true)
+{
+ char const* sourceCode = "contract test {\n"
+ " function f() { var x = true; }"
+ "}\n";
+ bytes code = compileFirstExpression(sourceCode);
+
+ bytes expectation({byte(eth::Instruction::PUSH1), 0x1});
+ BOOST_CHECK_EQUAL_COLLECTIONS(code.begin(), code.end(), expectation.begin(), expectation.end());
+}
+
+BOOST_AUTO_TEST_CASE(literal_false)
+{
+ char const* sourceCode = "contract test {\n"
+ " function f() { var x = false; }"
+ "}\n";
+ bytes code = compileFirstExpression(sourceCode);
+
+ bytes expectation({byte(eth::Instruction::PUSH1), 0x0});
+ BOOST_CHECK_EQUAL_COLLECTIONS(code.begin(), code.end(), expectation.begin(), expectation.end());
+}
+
+BOOST_AUTO_TEST_CASE(int_literal)
+{
+ char const* sourceCode = "contract test {\n"
+ " function f() { var x = 0x12345678901234567890; }"
+ "}\n";
+ bytes code = compileFirstExpression(sourceCode);
+
+ bytes expectation({byte(eth::Instruction::PUSH10), 0x12, 0x34, 0x56, 0x78, 0x90,
+ 0x12, 0x34, 0x56, 0x78, 0x90});
+ BOOST_CHECK_EQUAL_COLLECTIONS(code.begin(), code.end(), expectation.begin(), expectation.end());
+}
+
+BOOST_AUTO_TEST_CASE(comparison)
+{
+ char const* sourceCode = "contract test {\n"
+ " function f() { var x = (0x10aa < 0x11aa) != true; }"
+ "}\n";
+ bytes code = compileFirstExpression(sourceCode);
+
+ bytes expectation({byte(eth::Instruction::PUSH2), 0x10, 0xaa,
+ byte(eth::Instruction::PUSH2), 0x11, 0xaa,
+ byte(eth::Instruction::GT),
+ byte(eth::Instruction::PUSH1), 0x1,
+ byte(eth::Instruction::EQ),
+ byte(eth::Instruction::NOT)});
+ BOOST_CHECK_EQUAL_COLLECTIONS(code.begin(), code.end(), expectation.begin(), expectation.end());
+}
+
+BOOST_AUTO_TEST_CASE(short_circuiting)
+{
+ char const* sourceCode = "contract test {\n"
+ " function f() { var x = (10 + 8 >= 4 || 2 != 9) != true; }"
+ "}\n";
+ bytes code = compileFirstExpression(sourceCode);
+
+ bytes expectation({byte(eth::Instruction::PUSH1), 0xa,
+ byte(eth::Instruction::PUSH1), 0x8,
+ byte(eth::Instruction::ADD),
+ byte(eth::Instruction::PUSH1), 0x4,
+ byte(eth::Instruction::GT),
+ byte(eth::Instruction::NOT), // after this we have 10 + 8 >= 4
+ byte(eth::Instruction::DUP1),
+ byte(eth::Instruction::PUSH1), 0x14,
+ byte(eth::Instruction::JUMPI), // short-circuit if it is true
+ byte(eth::Instruction::PUSH1), 0x2,
+ byte(eth::Instruction::PUSH1), 0x9,
+ byte(eth::Instruction::EQ),
+ byte(eth::Instruction::NOT), // after this we have 2 != 9
+ byte(eth::Instruction::JUMPDEST),
+ byte(eth::Instruction::PUSH1), 0x1,
+ byte(eth::Instruction::EQ),
+ byte(eth::Instruction::NOT)});
+ BOOST_CHECK_EQUAL_COLLECTIONS(code.begin(), code.end(), expectation.begin(), expectation.end());
+}
+
+BOOST_AUTO_TEST_CASE(arithmetics)
+{
+ char const* sourceCode = "contract test {\n"
+ " function f() { var x = (1 * (2 / (3 % (4 + (5 - (6 | (7 & (8 ^ 9)))))))); }"
+ "}\n";
+ bytes code = compileFirstExpression(sourceCode);
+
+ bytes expectation({byte(eth::Instruction::PUSH1), 0x1,
+ byte(eth::Instruction::PUSH1), 0x2,
+ byte(eth::Instruction::PUSH1), 0x3,
+ byte(eth::Instruction::PUSH1), 0x4,
+ byte(eth::Instruction::PUSH1), 0x5,
+ byte(eth::Instruction::PUSH1), 0x6,
+ byte(eth::Instruction::PUSH1), 0x7,
+ byte(eth::Instruction::PUSH1), 0x8,
+ byte(eth::Instruction::PUSH1), 0x9,
+ byte(eth::Instruction::XOR),
+ byte(eth::Instruction::AND),
+ byte(eth::Instruction::OR),
+ byte(eth::Instruction::SWAP1),
+ byte(eth::Instruction::SUB),
+ byte(eth::Instruction::ADD),
+ byte(eth::Instruction::MOD),
+ byte(eth::Instruction::DIV),
+ byte(eth::Instruction::MUL)});
+ BOOST_CHECK_EQUAL_COLLECTIONS(code.begin(), code.end(), expectation.begin(), expectation.end());
+}
+
+BOOST_AUTO_TEST_CASE(unary_operators)
+{
+ char const* sourceCode = "contract test {\n"
+ " function f() { var x = !(~+-(--(++1++)--) == 2); }"
+ "}\n";
+ bytes code = compileFirstExpression(sourceCode);
+
+ bytes expectation({byte(eth::Instruction::PUSH1), 0x1,
+ byte(eth::Instruction::PUSH1), 0x1,
+ byte(eth::Instruction::ADD),
+ byte(eth::Instruction::PUSH1), 0x1,
+ byte(eth::Instruction::SWAP1),
+ byte(eth::Instruction::SUB),
+ byte(eth::Instruction::PUSH1), 0x0,
+ byte(eth::Instruction::SUB),
+ byte(eth::Instruction::NOT),
+ byte(eth::Instruction::PUSH1), 0x2,
+ byte(eth::Instruction::EQ),
+ byte(eth::Instruction::ISZERO)});
+ BOOST_CHECK_EQUAL_COLLECTIONS(code.begin(), code.end(), expectation.begin(), expectation.end());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+}
+}
+} // end namespaces
+
diff --git a/solidityNameAndTypeResolution.cpp b/solidityNameAndTypeResolution.cpp
index 833ae6d4b..9e34e6d0e 100644
--- a/solidityNameAndTypeResolution.cpp
+++ b/solidityNameAndTypeResolution.cpp
@@ -38,7 +38,7 @@ namespace test
namespace
{
-void parseTextAndResolveNames(const std::string& _source)
+void parseTextAndResolveNames(std::string const& _source)
{
Parser parser;
ASTPointer contract = parser.parse(
diff --git a/solidityParser.cpp b/solidityParser.cpp
index 701a6e76c..4ca9370d6 100644
--- a/solidityParser.cpp
+++ b/solidityParser.cpp
@@ -37,7 +37,7 @@ namespace test
namespace
{
-ASTPointer parseText(const std::string& _source)
+ASTPointer parseText(std::string const& _source)
{
Parser parser;
return parser.parse(std::make_shared(CharStream(_source)));
diff --git a/vm.cpp b/vm.cpp
index 76ed41a44..617cb95c7 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -471,7 +471,7 @@ h160 FakeState::createNewAddress(Address _newAddress, Address _sender, u256 _end
}
// Set up new account...
- m_cache[_newAddress] = AddressState(0, balance(_newAddress) + _endowment, h256(), h256());
+ m_cache[_newAddress] = Account(0, balance(_newAddress) + _endowment, h256(), h256());
// Execute init code.
VM vm(*_gas);
diff --git a/vmArithmeticTestFiller.json b/vmArithmeticTestFiller.json
index 9e9538386..717257e22 100644
--- a/vmArithmeticTestFiller.json
+++ b/vmArithmeticTestFiller.json
@@ -1319,7 +1319,7 @@
},
- "neg0": {
+ "bnot0": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
@@ -1347,7 +1347,7 @@
}
},
- "neg1": {
+ "bnot1": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
@@ -1375,7 +1375,7 @@
}
},
- "neg2": {
+ "bnot2": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
@@ -1403,7 +1403,7 @@
}
},
- "neg3": {
+ "bnot3": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
@@ -1431,7 +1431,7 @@
}
},
- "neg4": {
+ "bnot4": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
@@ -1459,7 +1459,7 @@
}
},
- "neg5": {
+ "bnot5": {
"env" : {
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
"currentNumber" : "0",
diff --git a/vmBitwiseLogicOperationTestFiller.json b/vmBitwiseLogicOperationTestFiller.json
index ee00d9784..5f3aabfcc 100644
--- a/vmBitwiseLogicOperationTestFiller.json
+++ b/vmBitwiseLogicOperationTestFiller.json
@@ -1224,6 +1224,342 @@
"gasPrice" : "100000000000000",
"gas" : "10000"
}
+ },
+
+ "signextend_bitIsSet": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : 0,
+ "code" : "0x62122ff4600016600057",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "signextend_BitIsNotSet": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : 0,
+ "code" : "0x62122f6a600016600057",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "signextend_BitIsSetInHigherByte": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : 0,
+ "code" : "0x6212faf4600116600057",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "signextend_BitIsNotSetInHigherByte": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : 0,
+ "code" : "0x62126af4600116600057",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "signextendInvalidByteNumber": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : 0,
+ "code" : "0x62126af4605016600057",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "signextend_00": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : 0,
+ "code" : "{ [[ 0 ]] (SIGNEXTEND 0 0) } ",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "signextend_BigByte_0": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : 0,
+ "code" : "{ [[ 0 ]] (SIGNEXTEND 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0) } ",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "signextend_0_BigByte": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : 0,
+ "code" : "{ [[ 0 ]] (SIGNEXTEND 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) } ",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "signextend_BigByteBigByte": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : 0,
+ "code" : "{ [[ 0 ]] (SIGNEXTEND 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) } ",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "signextend_AlmostBiggestByte": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : 0,
+ "code" : "{ [[ 0 ]] (SIGNEXTEND 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe) } ",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "signextend_bigBytePlus1": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : 0,
+ "code" : "0x66f000000000000161ffff16600057",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
+ },
+
+ "signextend_BigBytePlus1_2": {
+ "env" : {
+ "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
+ "currentNumber" : "0",
+ "currentGasLimit" : "1000000",
+ "currentDifficulty" : "256",
+ "currentTimestamp" : 1,
+ "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+ },
+ "pre" : {
+ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+ "balance" : "1000000000000000000",
+ "nonce" : 0,
+ "code" : "0x60ff68f0000000000000000116600057",
+ "storage": {}
+ }
+ },
+ "exec" : {
+ "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+ "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+ "value" : "1000000000000000000",
+ "data" : "",
+ "gasPrice" : "100000000000000",
+ "gas" : "10000"
+ }
}
}
diff --git a/webthreestubclient.h b/webthreestubclient.h
new file mode 100644
index 000000000..6beee5bb6
--- /dev/null
+++ b/webthreestubclient.h
@@ -0,0 +1,587 @@
+/**
+ * THIS FILE IS GENERATED BY jsonrpcstub, DO NOT CHANGE IT!!!!!
+ */
+
+#ifndef _WEBTHREESTUBCLIENT_H_
+#define _WEBTHREESTUBCLIENT_H_
+
+#include
+
+class WebThreeStubClient
+{
+ public:
+ WebThreeStubClient(jsonrpc::AbstractClientConnector* conn)
+ {
+ this->client = new jsonrpc::Client(conn);
+ }
+ ~WebThreeStubClient()
+ {
+ delete this->client;
+ }
+
+ std::string account() throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p = Json::nullValue;
+ Json::Value result = this->client->CallMethod("account",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ Json::Value accounts() throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p = Json::nullValue;
+ Json::Value result = this->client->CallMethod("accounts",p);
+ if (result.isArray())
+ return result;
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string addToGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+p.append(param2);
+
+ Json::Value result = this->client->CallMethod("addToGroup",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string balanceAt(const std::string& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("balanceAt",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ Json::Value blockByHash(const std::string& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("blockByHash",p);
+ if (result.isObject())
+ return result;
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ Json::Value blockByNumber(const int& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("blockByNumber",p);
+ if (result.isObject())
+ return result;
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string call(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("call",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ bool changed(const int& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("changed",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string codeAt(const std::string& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("codeAt",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string coinbase() throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p = Json::nullValue;
+ Json::Value result = this->client->CallMethod("coinbase",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string compile(const std::string& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("compile",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ double countAt(const std::string& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("countAt",p);
+ if (result.isDouble())
+ return result.asDouble();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ int defaultBlock() throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p = Json::nullValue;
+ Json::Value result = this->client->CallMethod("defaultBlock",p);
+ if (result.isInt())
+ return result.asInt();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string gasPrice() throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p = Json::nullValue;
+ Json::Value result = this->client->CallMethod("gasPrice",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string get(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+p.append(param2);
+
+ Json::Value result = this->client->CallMethod("get",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ Json::Value getMessages(const int& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("getMessages",p);
+ if (result.isArray())
+ return result;
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string getString(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+p.append(param2);
+
+ Json::Value result = this->client->CallMethod("getString",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ bool haveIdentity(const std::string& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("haveIdentity",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ bool listening() throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p = Json::nullValue;
+ Json::Value result = this->client->CallMethod("listening",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ bool mining() throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p = Json::nullValue;
+ Json::Value result = this->client->CallMethod("mining",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ int newFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("newFilter",p);
+ if (result.isInt())
+ return result.asInt();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ int newFilterString(const std::string& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("newFilterString",p);
+ if (result.isInt())
+ return result.asInt();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string newGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+p.append(param2);
+
+ Json::Value result = this->client->CallMethod("newGroup",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string newIdentity() throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p = Json::nullValue;
+ Json::Value result = this->client->CallMethod("newIdentity",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ int number() throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p = Json::nullValue;
+ Json::Value result = this->client->CallMethod("number",p);
+ if (result.isInt())
+ return result.asInt();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ int peerCount() throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p = Json::nullValue;
+ Json::Value result = this->client->CallMethod("peerCount",p);
+ if (result.isInt())
+ return result.asInt();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ bool post(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("post",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ bool put(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+p.append(param2);
+p.append(param3);
+
+ Json::Value result = this->client->CallMethod("put",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ bool putString(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+p.append(param2);
+p.append(param3);
+
+ Json::Value result = this->client->CallMethod("putString",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ bool setCoinbase(const std::string& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("setCoinbase",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ bool setDefaultBlock(const int& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("setDefaultBlock",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ bool setListening(const bool& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("setListening",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ bool setMining(const bool& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("setMining",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ Json::Value shhChanged(const int& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("shhChanged",p);
+ if (result.isArray())
+ return result;
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ int shhNewFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("shhNewFilter",p);
+ if (result.isInt())
+ return result.asInt();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ bool shhUninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("shhUninstallFilter",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string stateAt(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+p.append(param2);
+
+ Json::Value result = this->client->CallMethod("stateAt",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ std::string transact(const Json::Value& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("transact",p);
+ if (result.isString())
+ return result.asString();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ Json::Value transactionByHash(const std::string& param1, const int& param2) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+p.append(param2);
+
+ Json::Value result = this->client->CallMethod("transactionByHash",p);
+ if (result.isObject())
+ return result;
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ Json::Value transactionByNumber(const int& param1, const int& param2) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+p.append(param2);
+
+ Json::Value result = this->client->CallMethod("transactionByNumber",p);
+ if (result.isObject())
+ return result;
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ Json::Value uncleByHash(const std::string& param1, const int& param2) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+p.append(param2);
+
+ Json::Value result = this->client->CallMethod("uncleByHash",p);
+ if (result.isObject())
+ return result;
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ Json::Value uncleByNumber(const int& param1, const int& param2) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+p.append(param2);
+
+ Json::Value result = this->client->CallMethod("uncleByNumber",p);
+ if (result.isObject())
+ return result;
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ bool uninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p.append(param1);
+
+ Json::Value result = this->client->CallMethod("uninstallFilter",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
+ private:
+ jsonrpc::Client* client;
+};
+#endif //_WEBTHREESTUBCLIENT_H_