Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroNazarenko committed Feb 27, 2024
1 parent 2f7d9ef commit 0f9715b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions TestUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,25 +811,18 @@ void TestUtils::doDKGV2(StubClient &c, int n, int t,
}

auto allPubKeysJson = c.calculateAllBLSPublicKeys(publicSharesJson, t, n);
Json::FastWriter fastWriter;
std::string output = fastWriter.write(allPubKeysJson);
std::cout << "ALL PUBLIC KEYS: " << output << '\n';
std::vector<std::shared_ptr< BLSPublicKeyShare> > allPubKeysFromServer(n);
for (int i = 0; i < n; i++) {
std::string publicKeyStr = allPubKeysJson["publicKeys"][i].asString();
std::cout << "PK: " << publicKeyStr << '\n';
vector<string> pubKeyVect = splitString( publicKeyStr.c_str(), ':' );
for (size_t j = 0; j < pubKeyVect.size(); ++j) {
std::cout << pubKeyVect[j] << ' ';
}
CHECK_STATE(pubKeyVect.size() == 4);
BLSPublicKeyShare pubKey(make_shared<vector<string>>(pubKeyVect), t, n);

allPubKeysFromServer[i] = make_shared<BLSPublicKeyShare>(pubKey);
}

for (size_t i = 0; i < n; ++i) {
CHECK_STATE( allPubKeysFromServer[i] == pubKeyShares[i + 1] );
CHECK_STATE( *(allPubKeysFromServer[i]->getPublicKey()) == *(pubKeyShares[i + 1]->getPublicKey()) );
}

// create pub key
Expand Down

0 comments on commit 0f9715b

Please sign in to comment.