|
|
@ -13,12 +13,12 @@ class AbstractEthStubServer : public jsonrpc::AbstractServer<AbstractEthStubServ |
|
|
|
AbstractEthStubServer(jsonrpc::AbstractServerConnector* conn) : |
|
|
|
jsonrpc::AbstractServer<AbstractEthStubServer>(conn) |
|
|
|
{ |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("balanceAt", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "a",jsonrpc::JSON_STRING,"block",jsonrpc::JSON_INTEGER, NULL), &AbstractEthStubServer::balanceAtI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("balanceAt", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "address",jsonrpc::JSON_STRING,"block",jsonrpc::JSON_INTEGER, NULL), &AbstractEthStubServer::balanceAtI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("block", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "numberOrHash",jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::blockI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("call", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "json",jsonrpc::JSON_OBJECT, NULL), &AbstractEthStubServer::callI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("codeAt", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "a",jsonrpc::JSON_STRING,"block",jsonrpc::JSON_INTEGER, NULL), &AbstractEthStubServer::codeAtI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("codeAt", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "address",jsonrpc::JSON_STRING,"block",jsonrpc::JSON_INTEGER, NULL), &AbstractEthStubServer::codeAtI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("coinbase", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::coinbaseI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("countAt", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_REAL, "a",jsonrpc::JSON_STRING,"block",jsonrpc::JSON_INTEGER, NULL), &AbstractEthStubServer::countAtI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("countAt", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_REAL, "address",jsonrpc::JSON_STRING,"block",jsonrpc::JSON_INTEGER, NULL), &AbstractEthStubServer::countAtI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("defaultBlock", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_INTEGER, NULL), &AbstractEthStubServer::defaultBlockI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("fromAscii", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "padding",jsonrpc::JSON_INTEGER,"s",jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::fromAsciiI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("fromFixed", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_REAL, "s",jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::fromFixedI); |
|
|
@ -36,7 +36,7 @@ class AbstractEthStubServer : public jsonrpc::AbstractServer<AbstractEthStubServ |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("setListening", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_BOOLEAN, "listening",jsonrpc::JSON_BOOLEAN, NULL), &AbstractEthStubServer::setListeningI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("setMining", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_BOOLEAN, "mining",jsonrpc::JSON_BOOLEAN, NULL), &AbstractEthStubServer::setMiningI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("sha3", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "s",jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::sha3I); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("stateAt", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "a",jsonrpc::JSON_STRING,"block",jsonrpc::JSON_INTEGER,"s",jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::stateAtI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("stateAt", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "address",jsonrpc::JSON_STRING,"block",jsonrpc::JSON_INTEGER,"storage",jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::stateAtI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("toAscii", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "s",jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::toAsciiI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("toDecimal", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "s",jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::toDecimalI); |
|
|
|
this->bindAndAddMethod(new jsonrpc::Procedure("toFixed", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "s",jsonrpc::JSON_REAL, NULL), &AbstractEthStubServer::toFixedI); |
|
|
@ -49,7 +49,7 @@ class AbstractEthStubServer : public jsonrpc::AbstractServer<AbstractEthStubServ |
|
|
|
|
|
|
|
inline virtual void balanceAtI(const Json::Value& request, Json::Value& response) |
|
|
|
{ |
|
|
|
response = this->balanceAt(request["a"].asString(), request["block"].asInt()); |
|
|
|
response = this->balanceAt(request["address"].asString(), request["block"].asInt()); |
|
|
|
} |
|
|
|
|
|
|
|
inline virtual void blockI(const Json::Value& request, Json::Value& response) |
|
|
@ -64,7 +64,7 @@ class AbstractEthStubServer : public jsonrpc::AbstractServer<AbstractEthStubServ |
|
|
|
|
|
|
|
inline virtual void codeAtI(const Json::Value& request, Json::Value& response) |
|
|
|
{ |
|
|
|
response = this->codeAt(request["a"].asString(), request["block"].asInt()); |
|
|
|
response = this->codeAt(request["address"].asString(), request["block"].asInt()); |
|
|
|
} |
|
|
|
|
|
|
|
inline virtual void coinbaseI(const Json::Value& request, Json::Value& response) |
|
|
@ -74,7 +74,7 @@ class AbstractEthStubServer : public jsonrpc::AbstractServer<AbstractEthStubServ |
|
|
|
|
|
|
|
inline virtual void countAtI(const Json::Value& request, Json::Value& response) |
|
|
|
{ |
|
|
|
response = this->countAt(request["a"].asString(), request["block"].asInt()); |
|
|
|
response = this->countAt(request["address"].asString(), request["block"].asInt()); |
|
|
|
} |
|
|
|
|
|
|
|
inline virtual void defaultBlockI(const Json::Value& request, Json::Value& response) |
|
|
@ -164,7 +164,7 @@ class AbstractEthStubServer : public jsonrpc::AbstractServer<AbstractEthStubServ |
|
|
|
|
|
|
|
inline virtual void stateAtI(const Json::Value& request, Json::Value& response) |
|
|
|
{ |
|
|
|
response = this->stateAt(request["a"].asString(), request["block"].asInt(), request["s"].asString()); |
|
|
|
response = this->stateAt(request["address"].asString(), request["block"].asInt(), request["storage"].asString()); |
|
|
|
} |
|
|
|
|
|
|
|
inline virtual void toAsciiI(const Json::Value& request, Json::Value& response) |
|
|
@ -203,12 +203,12 @@ class AbstractEthStubServer : public jsonrpc::AbstractServer<AbstractEthStubServ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
virtual std::string balanceAt(const std::string& a, const int& block) = 0; |
|
|
|
virtual std::string balanceAt(const std::string& address, const int& block) = 0; |
|
|
|
virtual Json::Value block(const std::string& numberOrHash) = 0; |
|
|
|
virtual std::string call(const Json::Value& json) = 0; |
|
|
|
virtual std::string codeAt(const std::string& a, const int& block) = 0; |
|
|
|
virtual std::string codeAt(const std::string& address, const int& block) = 0; |
|
|
|
virtual std::string coinbase() = 0; |
|
|
|
virtual double countAt(const std::string& a, const int& block) = 0; |
|
|
|
virtual double countAt(const std::string& address, const int& block) = 0; |
|
|
|
virtual int defaultBlock() = 0; |
|
|
|
virtual std::string fromAscii(const int& padding, const std::string& s) = 0; |
|
|
|
virtual double fromFixed(const std::string& s) = 0; |
|
|
@ -226,7 +226,7 @@ class AbstractEthStubServer : public jsonrpc::AbstractServer<AbstractEthStubServ |
|
|
|
virtual bool setListening(const bool& listening) = 0; |
|
|
|
virtual bool setMining(const bool& mining) = 0; |
|
|
|
virtual std::string sha3(const std::string& s) = 0; |
|
|
|
virtual std::string stateAt(const std::string& a, const int& block, const std::string& s) = 0; |
|
|
|
virtual std::string stateAt(const std::string& address, const int& block, const std::string& storage) = 0; |
|
|
|
virtual std::string toAscii(const std::string& s) = 0; |
|
|
|
virtual std::string toDecimal(const std::string& s) = 0; |
|
|
|
virtual std::string toFixed(const double& s) = 0; |
|
|
|