Unverified Commit cc2718b9 authored by Oleh's avatar Oleh

SKALE-2835 fix bls key share naming, remove redundant function

parent 9a8dbc50
...@@ -654,8 +654,7 @@ Json::Value SGXWalletServer::deleteBlsKeyImpl(const std::string& name) { ...@@ -654,8 +654,7 @@ Json::Value SGXWalletServer::deleteBlsKeyImpl(const std::string& name) {
if (!checkName(name, "BLS_KEY")) { if (!checkName(name, "BLS_KEY")) {
throw SGXException(INVALID_BLS_NAME, "Invalid BLSKey name format"); throw SGXException(INVALID_BLS_NAME, "Invalid BLSKey name format");
} }
std::string key = "BLSKEYSHARE:" + name; std::shared_ptr <std::string> bls_ptr = LevelDB::getLevelDb()->readString(name);
std::shared_ptr <std::string> bls_ptr = LevelDB::getLevelDb()->readString(key);
if (bls_ptr != nullptr) { if (bls_ptr != nullptr) {
LevelDB::getLevelDb()->deleteKey(name); LevelDB::getLevelDb()->deleteKey(name);
...@@ -783,16 +782,6 @@ shared_ptr <string> SGXWalletServer::readFromDb(const string &name, const string ...@@ -783,16 +782,6 @@ shared_ptr <string> SGXWalletServer::readFromDb(const string &name, const string
return dataStr; return dataStr;
} }
shared_ptr <string> SGXWalletServer::readKeyShare(const string &_keyShareName) {
auto keyShareStr = LevelDB::getLevelDb()->readString("BLSKEYSHARE:" + _keyShareName);
if (keyShareStr == nullptr) {
throw SGXException(KEY_SHARE_DOES_NOT_EXIST, "Key share with this name does not exist");
}
return keyShareStr;
}
void SGXWalletServer::writeKeyShare(const string &_keyShareName, const string &_value, int _index, int _n, int _t) { void SGXWalletServer::writeKeyShare(const string &_keyShareName, const string &_value, int _index, int _n, int _t) {
Json::Value val; Json::Value val;
Json::FastWriter writer; Json::FastWriter writer;
......
...@@ -105,8 +105,6 @@ public: ...@@ -105,8 +105,6 @@ public:
static void writeKeyShare(const string &_keyShareName, const string &_value, int _index, int _n, int _t); static void writeKeyShare(const string &_keyShareName, const string &_value, int _index, int _n, int _t);
static shared_ptr<string> readKeyShare(const string &_keyShare);
static Json::Value static Json::Value
importBLSKeyShareImpl(const string &_keyShare, const string &_keyShareName, int t, int n, int _index); importBLSKeyShareImpl(const string &_keyShare, const string &_keyShareName, int t, int n, int _index);
......
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