Fabcoin Core  0.16.2
P2P Digital Currency
TestFace.h
Go to the documentation of this file.
1 
5 #ifndef JSONRPC_CPP_STUB_DEV_RPC_TESTFACE_H_
6 #define JSONRPC_CPP_STUB_DEV_RPC_TESTFACE_H_
7 
8 #include "ModularServer.h"
9 
10 namespace dev {
11  namespace rpc {
12  class TestFace : public ServerInterface<TestFace>
13  {
14  public:
16  {
17  this->bindAndAddMethod(jsonrpc::Procedure("test_setChainParams", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_OBJECT, NULL), &dev::rpc::TestFace::test_setChainParamsI);
18  this->bindAndAddMethod(jsonrpc::Procedure("test_mineBlocks", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &dev::rpc::TestFace::test_mineBlocksI);
19  this->bindAndAddMethod(jsonrpc::Procedure("test_modifyTimestamp", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &dev::rpc::TestFace::test_modifyTimestampI);
20  this->bindAndAddMethod(jsonrpc::Procedure("test_addBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &dev::rpc::TestFace::test_addBlockI);
21  this->bindAndAddMethod(jsonrpc::Procedure("test_rewindToBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &dev::rpc::TestFace::test_rewindToBlockI);
22  }
23 
24  inline virtual void test_setChainParamsI(const Json::Value &request, Json::Value &response)
25  {
26  response = this->test_setChainParams(request[0u]);
27  }
28  inline virtual void test_mineBlocksI(const Json::Value &request, Json::Value &response)
29  {
30  response = this->test_mineBlocks(request[0u].asInt());
31  }
32  inline virtual void test_modifyTimestampI(const Json::Value &request, Json::Value &response)
33  {
34  response = this->test_modifyTimestamp(request[0u].asInt());
35  }
36  inline virtual void test_addBlockI(const Json::Value &request, Json::Value &response)
37  {
38  response = this->test_addBlock(request[0u].asString());
39  }
40  inline virtual void test_rewindToBlockI(const Json::Value &request, Json::Value &response)
41  {
42  response = this->test_rewindToBlock(request[0u].asInt());
43  }
44  virtual bool test_setChainParams(const Json::Value& param1) = 0;
45  virtual bool test_mineBlocks(int param1) = 0;
46  virtual bool test_modifyTimestamp(int param1) = 0;
47  virtual bool test_addBlock(const std::string& param1) = 0;
48  virtual bool test_rewindToBlock(int param1) = 0;
49  };
50 
51  }
52 }
53 #endif //JSONRPC_CPP_STUB_DEV_RPC_TESTFACE_H_
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Definition: Arith256.cpp:15
virtual bool test_modifyTimestamp(int param1)=0
virtual bool test_mineBlocks(int param1)=0
virtual bool test_rewindToBlock(int param1)=0
virtual bool test_addBlock(const std::string &param1)=0
void bindAndAddMethod(jsonrpc::Procedure const &_proc, MethodPointer _pointer)
Definition: ModularServer.h:59
virtual void test_rewindToBlockI(const Json::Value &request, Json::Value &response)
Definition: TestFace.h:40
Config::Value_type Value
virtual bool test_setChainParams(const Json::Value &param1)=0
virtual void test_addBlockI(const Json::Value &request, Json::Value &response)
Definition: TestFace.h:36
virtual void test_modifyTimestampI(const Json::Value &request, Json::Value &response)
Definition: TestFace.h:32
virtual void test_mineBlocksI(const Json::Value &request, Json::Value &response)
Definition: TestFace.h:28
virtual void test_setChainParamsI(const Json::Value &request, Json::Value &response)
Definition: TestFace.h:24
std::string asString(bytes const &_b)
Converts byte array to a string containing the same (binary) data.
Definition: CommonData.h:79