SKALE-2002 fix build

parent 45fa3241
...@@ -734,7 +734,7 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") { ...@@ -734,7 +734,7 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") {
StubClient c(client, JSONRPC_CLIENT_V2); StubClient c(client, JSONRPC_CLIENT_V2);
int n = 16, t = 16; int n = 16, t = 16;
Json::Value etnKeys[n]; Json::Value ethKeys[n];
Json::Value verifVects[n]; Json::Value verifVects[n];
Json::Value pubEthKeys; Json::Value pubEthKeys;
Json::Value secretShares[n]; Json::Value secretShares[n];
...@@ -746,7 +746,7 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") { ...@@ -746,7 +746,7 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") {
int schainID = randGen(); int schainID = randGen();
int dkgID = randGen(); int dkgID = randGen();
for (uint8_t i = 0; i < n; i++) { for (uint8_t i = 0; i < n; i++) {
etnKeys[i] = c.generateECDSAKey(); ethKeys[i] = c.generateECDSAKey();
REQUIRE(ethKeys[i]["status"] == 0); REQUIRE(ethKeys[i]["status"] == 0);
string polyName = string polyName =
"POLY:SCHAIN_ID:" + to_string(schainID) + ":NODE_ID:" + to_string(i) + ":DKG_ID:" + to_string(dkgID); "POLY:SCHAIN_ID:" + to_string(schainID) + ":NODE_ID:" + to_string(i) + ":DKG_ID:" + to_string(dkgID);
...@@ -756,7 +756,7 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") { ...@@ -756,7 +756,7 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") {
polyNames[i] = polyName; polyNames[i] = polyName;
verifVects[i] = c.getVerificationVector(polyName, t, n); verifVects[i] = c.getVerificationVector(polyName, t, n);
REQUIRE(verifVects[i]["status"] == 0); REQUIRE(verifVects[i]["status"] == 0);
pubEthKeys.append(etnKeys[i]["publicKey"]); pubEthKeys.append(ethKeys[i]["publicKey"]);
} }
for (uint8_t i = 0; i < n; i++) { for (uint8_t i = 0; i < n; i++) {
...@@ -781,7 +781,7 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") { ...@@ -781,7 +781,7 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") {
for (int j = 0; j < n; j++) { for (int j = 0; j < n; j++) {
string secretShare = secretShares[i]["secretShare"].asString().substr(192 * j, 192); string secretShare = secretShares[i]["secretShare"].asString().substr(192 * j, 192);
secShares[i] += secretShares[j]["secretShare"].asString().substr(192 * i, 192); secShares[i] += secretShares[j]["secretShare"].asString().substr(192 * i, 192);
auto responce = c.dkgVerification(pubShares[i], etnKeys[j]["keyName"].asString(), secretShare, t, n, Json::Value responce = c.dkgVerification(pubShares[i], ethKeys[j]["keyName"].asString(), secretShare, t, n,
j)["result"].asBool(); j)["result"].asBool();
REQUIRE(responce["status"] == 0); REQUIRE(responce["status"] == 0);
...@@ -791,7 +791,7 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") { ...@@ -791,7 +791,7 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") {
k++; k++;
pSharesBad[i][0] = 'q'; pSharesBad[i][0] = 'q';
Json::Value wrongVerif = c.dkgVerification(pSharesBad[i], etnKeys[j]["keyName"].asString(), secretShare, t, Json::Value wrongVerif = c.dkgVerification(pSharesBad[i], ethKeys[j]["keyName"].asString(), secretShare, t,
n, j); n, j);
res = wrongVerif["result"].asBool(); res = wrongVerif["result"].asBool();
REQUIRE(!res); REQUIRE(!res);
...@@ -814,7 +814,7 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") { ...@@ -814,7 +814,7 @@ TEST_CASE_METHOD(TestFixture, "DKG_BLS test", "[dkg-bls]") {
string blsName = "BLS_KEY" + polyNames[i].substr(4); string blsName = "BLS_KEY" + polyNames[i].substr(4);
string secretShare = secretShares[i]["secretShare"].asString(); string secretShare = secretShares[i]["secretShare"].asString();
auto response = c.createBLSPrivateKey(blsName, etnKeys[i]["keyName"].asString(), polyNames[i], secShares[i], t, n); auto response = c.createBLSPrivateKey(blsName, ethKeys[i]["keyName"].asString(), polyNames[i], secShares[i], t, n);
REQUIRE(response["status"] == 0); REQUIRE(response["status"] == 0);
pubBLSKeys[i] = c.getBLSPublicKeyShare(blsName); pubBLSKeys[i] = c.getBLSPublicKeyShare(blsName);
REQUIRE(pubBLSKeys[i]["status"] == 0); REQUIRE(pubBLSKeys[i]["status"] == 0);
......
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