diff --git a/libjsqrc/main.js b/libjsqrc/main.js index c1da61cd2..aff67e22b 100644 --- a/libjsqrc/main.js +++ b/libjsqrc/main.js @@ -87,7 +87,8 @@ { name: 'block', call: blockCall }, { name: 'transaction', call: transactionCall }, { name: 'uncle', call: uncleCall }, - { name: 'compile', call: 'eth_compile' } + { name: 'compile', call: 'eth_compile' }, + { name: 'lll', call: 'eth_lll' } ]; return methods; }; diff --git a/libweb3jsonrpc/WebThreeStubServer.cpp b/libweb3jsonrpc/WebThreeStubServer.cpp index 4556a1556..5338bda17 100644 --- a/libweb3jsonrpc/WebThreeStubServer.cpp +++ b/libweb3jsonrpc/WebThreeStubServer.cpp @@ -521,6 +521,11 @@ std::string WebThreeStubServer::eth_compile(string const& _s) return toJS(dev::eth::compileLLL(_s)); } +std::string WebThreeStubServer::eth_lll(string const& _s) +{ + return toJS(dev::eth::compileLLL(_s)); +} + int WebThreeStubServer::eth_number() { return client() ? client()->number() + 1 : 0; diff --git a/libweb3jsonrpc/WebThreeStubServer.h b/libweb3jsonrpc/WebThreeStubServer.h index 6a8d24470..10ca2fd76 100644 --- a/libweb3jsonrpc/WebThreeStubServer.h +++ b/libweb3jsonrpc/WebThreeStubServer.h @@ -86,6 +86,7 @@ public: virtual bool eth_setCoinbase(std::string const& _address); virtual bool eth_setDefaultBlock(int const& _block); virtual bool eth_setListening(bool const& _listening); + virtual std::string eth_lll(std::string const& _s); virtual bool eth_setMining(bool const& _mining); virtual std::string eth_stateAt(std::string const& _address, std::string const& _storage); virtual std::string eth_transact(Json::Value const& _json); diff --git a/libweb3jsonrpc/abstractwebthreestubserver.h b/libweb3jsonrpc/abstractwebthreestubserver.h index da2f9c754..dc99ddcc6 100644 --- a/libweb3jsonrpc/abstractwebthreestubserver.h +++ b/libweb3jsonrpc/abstractwebthreestubserver.h @@ -31,6 +31,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServerbindAndAddMethod(new jsonrpc::Procedure("eth_gasPrice", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_gasPriceI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_getMessages", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_getMessagesI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_listening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_listeningI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_lll", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_lllI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_mining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_miningI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_newFilterI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilterString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_newFilterStringI); @@ -148,6 +149,11 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServereth_listening(); } + inline virtual void eth_lllI(const Json::Value& request, Json::Value& response) + { + response = this->eth_lll(request[0u].asString()); + } + inline virtual void eth_miningI(const Json::Value& request, Json::Value& response) { response = this->eth_mining(); @@ -287,6 +293,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServerclient->CallMethod("eth_lll",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + bool eth_mining() throw (jsonrpc::JsonRpcException) { Json::Value p;