SKALE-3007 remove unused parameters

parent 6b72d7ca
...@@ -165,7 +165,7 @@ int SGXWalletServer::initHttpServer() { //without ssl ...@@ -165,7 +165,7 @@ int SGXWalletServer::initHttpServer() { //without ssl
} }
Json::Value Json::Value
SGXWalletServer::importBLSKeyShareImpl(const string &_keyShare, const string &_keyShareName, int t, int n) { SGXWalletServer::importBLSKeyShareImpl(const string &_keyShare, const string &_keyShareName) {
INIT_RESULT(result); INIT_RESULT(result);
result["encryptedKeyShare"] = ""; result["encryptedKeyShare"] = "";
...@@ -177,10 +177,6 @@ SGXWalletServer::importBLSKeyShareImpl(const string &_keyShare, const string &_k ...@@ -177,10 +177,6 @@ SGXWalletServer::importBLSKeyShareImpl(const string &_keyShare, const string &_k
throw SGXException(INVALID_BLS_NAME, "Invalid BLS key name"); throw SGXException(INVALID_BLS_NAME, "Invalid BLS key name");
} }
if (!check_n_t(t, n)) {
throw SGXException(INVALID_DKG_PARAMS, "Invalid t/n parameters");
}
encryptedKeyShareHex = encryptBLSKeyShare2Hex(&errStatus, (char *) errMsg.data(), _keyShare.c_str()); encryptedKeyShareHex = encryptBLSKeyShare2Hex(&errStatus, (char *) errMsg.data(), _keyShare.c_str());
if (errStatus != 0) { if (errStatus != 0) {
...@@ -670,8 +666,8 @@ Json::Value SGXWalletServer::ecdsaSignMessageHash(int _base, const string &_keyS ...@@ -670,8 +666,8 @@ Json::Value SGXWalletServer::ecdsaSignMessageHash(int _base, const string &_keyS
} }
Json::Value Json::Value
SGXWalletServer::importBLSKeyShare(const string &_keyShare, const string &_keyShareName, int _t, int _n) { SGXWalletServer::importBLSKeyShare(const string &_keyShare, const string &_keyShareName) {
return importBLSKeyShareImpl(_keyShare, _keyShareName, _t, _n); return importBLSKeyShareImpl(_keyShare, _keyShareName);
} }
Json::Value SGXWalletServer::blsSignMessageHash(const string &_keyShareName, const string &_messageHash, int _t, int _n) { Json::Value SGXWalletServer::blsSignMessageHash(const string &_keyShareName, const string &_messageHash, int _t, int _n) {
......
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
SGXWalletServer(AbstractServerConnector &_connector, serverVersion_t _type); SGXWalletServer(AbstractServerConnector &_connector, serverVersion_t _type);
virtual Json::Value virtual Json::Value
importBLSKeyShare(const string &_keyShare, const string &_keyShareName, int _t, int _n); importBLSKeyShare(const string &_keyShare, const string &_keyShareName);
virtual Json::Value virtual Json::Value
blsSignMessageHash(const string &_keyShareName, const string &_messageHash, int _t, int _n); blsSignMessageHash(const string &_keyShareName, const string &_messageHash, int _t, int _n);
...@@ -97,7 +97,7 @@ public: ...@@ -97,7 +97,7 @@ public:
static void writeKeyShare(const string &_keyShareName, const string &_value); static void writeKeyShare(const string &_keyShareName, const string &_value);
static Json::Value static Json::Value
importBLSKeyShareImpl(const string &_keyShare, const string &_keyShareName, int t, int n); importBLSKeyShareImpl(const string &_keyShare, const string &_keyShareName);
static Json::Value static Json::Value
blsSignMessageHashImpl(const string &_keyShareName, const string &_messageHash, int t, int n); blsSignMessageHashImpl(const string &_keyShareName, const string &_messageHash, int t, int n);
......
...@@ -36,7 +36,7 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer> ...@@ -36,7 +36,7 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer>
public: public:
AbstractStubServer(jsonrpc::AbstractServerConnector &conn, jsonrpc::serverVersion_t type = jsonrpc::JSONRPC_SERVER_V2) : jsonrpc::AbstractServer<AbstractStubServer>(conn, type) AbstractStubServer(jsonrpc::AbstractServerConnector &conn, jsonrpc::serverVersion_t type = jsonrpc::JSONRPC_SERVER_V2) : jsonrpc::AbstractServer<AbstractStubServer>(conn, type)
{ {
this->bindAndAddMethod(jsonrpc::Procedure("importBLSKeyShare", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT,"keyShare",jsonrpc::JSON_STRING,"keyShareName",jsonrpc::JSON_STRING,"t",jsonrpc::JSON_INTEGER,"n",jsonrpc::JSON_INTEGER, NULL), &AbstractStubServer::importBLSKeyShareI); this->bindAndAddMethod(jsonrpc::Procedure("importBLSKeyShare", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT,"keyShare",jsonrpc::JSON_STRING,"keyShareName",jsonrpc::JSON_STRING, NULL), &AbstractStubServer::importBLSKeyShareI);
this->bindAndAddMethod(jsonrpc::Procedure("blsSignMessageHash", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "keyShareName",jsonrpc::JSON_STRING,"messageHash",jsonrpc::JSON_STRING,"t",jsonrpc::JSON_INTEGER, "n",jsonrpc::JSON_INTEGER, NULL), &AbstractStubServer::blsSignMessageHashI); this->bindAndAddMethod(jsonrpc::Procedure("blsSignMessageHash", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "keyShareName",jsonrpc::JSON_STRING,"messageHash",jsonrpc::JSON_STRING,"t",jsonrpc::JSON_INTEGER, "n",jsonrpc::JSON_INTEGER, NULL), &AbstractStubServer::blsSignMessageHashI);
this->bindAndAddMethod(jsonrpc::Procedure("importECDSAKey", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "key",jsonrpc::JSON_STRING,"keyName",jsonrpc::JSON_STRING, NULL), &AbstractStubServer::importECDSAKeyI); this->bindAndAddMethod(jsonrpc::Procedure("importECDSAKey", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "key",jsonrpc::JSON_STRING,"keyName",jsonrpc::JSON_STRING, NULL), &AbstractStubServer::importECDSAKeyI);
...@@ -62,7 +62,7 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer> ...@@ -62,7 +62,7 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer>
inline virtual void importBLSKeyShareI(const Json::Value &request, Json::Value &response) inline virtual void importBLSKeyShareI(const Json::Value &request, Json::Value &response)
{ {
response = this->importBLSKeyShare( request["keyShare"].asString(), request["keyShareName"].asString(), request["t"].asInt(), request["n"].asInt()); response = this->importBLSKeyShare( request["keyShare"].asString(), request["keyShareName"].asString());
} }
inline virtual void blsSignMessageHashI(const Json::Value &request, Json::Value &response) inline virtual void blsSignMessageHashI(const Json::Value &request, Json::Value &response)
{ {
...@@ -145,7 +145,7 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer> ...@@ -145,7 +145,7 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer>
response = this->deleteBlsKey(request["blsKeyName"].asString()); response = this->deleteBlsKey(request["blsKeyName"].asString());
} }
virtual Json::Value importBLSKeyShare(const std::string& keyShare, const std::string& keyShareName, int t, int n) = 0; virtual Json::Value importBLSKeyShare(const std::string& keyShare, const std::string& keyShareName) = 0;
virtual Json::Value blsSignMessageHash(const std::string& keyShareName, const std::string& messageHash, int t, int n ) = 0; virtual Json::Value blsSignMessageHash(const std::string& keyShareName, const std::string& messageHash, int t, int n ) = 0;
virtual Json::Value importECDSAKey(const std::string& key, const std::string& keyName) = 0; virtual Json::Value importECDSAKey(const std::string& key, const std::string& keyName) = 0;
virtual Json::Value generateECDSAKey() = 0; virtual Json::Value generateECDSAKey() = 0;
......
...@@ -12,13 +12,11 @@ class StubClient : public jsonrpc::Client ...@@ -12,13 +12,11 @@ class StubClient : public jsonrpc::Client
public: public:
StubClient(jsonrpc::IClientConnector &conn, jsonrpc::clientVersion_t type = jsonrpc::JSONRPC_CLIENT_V2) : jsonrpc::Client(conn, type) {} StubClient(jsonrpc::IClientConnector &conn, jsonrpc::clientVersion_t type = jsonrpc::JSONRPC_CLIENT_V2) : jsonrpc::Client(conn, type) {}
Json::Value importBLSKeyShare(const std::string& keyShare, const std::string& keyShareName, int t, int n) Json::Value importBLSKeyShare(const std::string& keyShare, const std::string& keyShareName)
{ {
Json::Value p; Json::Value p;
p["keyShare"] = keyShare; p["keyShare"] = keyShare;
p["keyShareName"] = keyShareName; p["keyShareName"] = keyShareName;
p["n"] = n;
p["t"] = t;
Json::Value result = this->CallMethod("importBLSKeyShare",p); Json::Value result = this->CallMethod("importBLSKeyShare",p);
if (result.isObject()) if (result.isObject())
return result; return result;
......
...@@ -420,7 +420,7 @@ TEST_CASE_METHOD(TestFixture, "Delete Bls Key", "[delete-bls-key]") { ...@@ -420,7 +420,7 @@ TEST_CASE_METHOD(TestFixture, "Delete Bls Key", "[delete-bls-key]") {
libff::alt_bn128_Fr key = libff::alt_bn128_Fr("6507625568967977077291849236396320012317305261598035438182864059942098934847"); libff::alt_bn128_Fr key = libff::alt_bn128_Fr("6507625568967977077291849236396320012317305261598035438182864059942098934847");
std::string key_str = TestUtils::stringFromFr(key); std::string key_str = TestUtils::stringFromFr(key);
PRINT_SRC_LINE PRINT_SRC_LINE
c.importBLSKeyShare(key_str, name, 1, 2); c.importBLSKeyShare(key_str, name);
PRINT_SRC_LINE PRINT_SRC_LINE
REQUIRE(c.deleteBlsKey(name)["deleted"] == true); REQUIRE(c.deleteBlsKey(name)["deleted"] == true);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment