-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from torusresearch/fix/node_index
Fix/node index
- Loading branch information
Showing
5 changed files
with
39 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ describe("torus utils cyan", function () { | |
upgraded: false, | ||
typeOfUser: "v1", | ||
}, | ||
nodesData: { nodeIndexes: [] }, | ||
nodesData: { nodeIndexes: result.nodesData.nodeIndexes }, | ||
}); | ||
}); | ||
|
||
|
@@ -76,7 +76,7 @@ describe("torus utils cyan", function () { | |
upgraded: false, | ||
typeOfUser: "v1", | ||
}, | ||
nodesData: { nodeIndexes: [] }, | ||
nodesData: { nodeIndexes: result1.nodesData.nodeIndexes }, | ||
}); | ||
|
||
const v2Verifier = "tkey-google-cyan"; | ||
|
@@ -108,7 +108,7 @@ describe("torus utils cyan", function () { | |
upgraded: false, | ||
typeOfUser: "v2", | ||
}, | ||
nodesData: { nodeIndexes: [] }, | ||
nodesData: { nodeIndexes: result2.nodesData.nodeIndexes }, | ||
}); | ||
// 2/n user | ||
const v2nTestEmail = "[email protected]"; | ||
|
@@ -138,7 +138,7 @@ describe("torus utils cyan", function () { | |
upgraded: false, | ||
typeOfUser: "v2", | ||
}, | ||
nodesData: { nodeIndexes: [] }, | ||
nodesData: { nodeIndexes: result3.nodesData.nodeIndexes }, | ||
}); | ||
}); | ||
|
||
|
@@ -161,23 +161,23 @@ describe("torus utils cyan", function () { | |
const verifierDetails = { verifier: TORUS_TEST_VERIFIER, verifierId: TORUS_TEST_EMAIL }; | ||
const { torusNodeEndpoints, torusIndexes } = await TORUS_NODE_MANAGER.getNodeDetails(verifierDetails); | ||
const result = await torus.retrieveShares(torusNodeEndpoints, torusIndexes, TORUS_TEST_VERIFIER, { verifier_id: TORUS_TEST_EMAIL }, token); | ||
expect(result.finalKeyData.privKey).to.be.equal("1e0c955d73e73558f46521da55cc66de7b8fcb56c5b24e851616849b6a1278c8"); | ||
delete result.sessionData; | ||
expect(result.finalKeyData.privKey).to.be.equal("5db51619684b32a2ff2375b4c03459d936179dfba401cb1c176b621e8a2e4ac8"); | ||
expect(result).eql({ | ||
finalKeyData: { | ||
evmAddress: "0x8AA6C8ddCD868873120aA265Fc63E3a2180375BA", | ||
X: "35739417e3be1b1e56cdf8c509d8dee5412712514b18df1bc961ac6465a0c949", | ||
Y: "887497602e62ced686eb99eaa0020b0c0d705cad96eafeec2dd1bbfb6a9d42c2", | ||
privKey: "1e0c955d73e73558f46521da55cc66de7b8fcb56c5b24e851616849b6a1278c8", | ||
X: "e2ed6033951af2851d1bea98799e62fb1ff24b952c1faea17922684678ba42d1", | ||
Y: "beef0efad88e81385952c0068ca48e8b9c2121be87cb0ddf18a68806db202359", | ||
evmAddress: "0xC615aA03Dd8C9b2dc6F7c43cBDfF2c34bBa47Ec9", | ||
privKey: "5db51619684b32a2ff2375b4c03459d936179dfba401cb1c176b621e8a2e4ac8", | ||
}, | ||
oAuthKeyData: { | ||
evmAddress: "0x8AA6C8ddCD868873120aA265Fc63E3a2180375BA", | ||
X: "35739417e3be1b1e56cdf8c509d8dee5412712514b18df1bc961ac6465a0c949", | ||
Y: "887497602e62ced686eb99eaa0020b0c0d705cad96eafeec2dd1bbfb6a9d42c2", | ||
privKey: "1e0c955d73e73558f46521da55cc66de7b8fcb56c5b24e851616849b6a1278c8", | ||
X: "e2ed6033951af2851d1bea98799e62fb1ff24b952c1faea17922684678ba42d1", | ||
Y: "beef0efad88e81385952c0068ca48e8b9c2121be87cb0ddf18a68806db202359", | ||
evmAddress: "0xC615aA03Dd8C9b2dc6F7c43cBDfF2c34bBa47Ec9", | ||
privKey: "5db51619684b32a2ff2375b4c03459d936179dfba401cb1c176b621e8a2e4ac8", | ||
}, | ||
sessionData: { sessionTokenData: [], sessionAuthKey: "" }, | ||
metadata: { pubNonce: undefined, nonce: new BN(0), typeOfUser: "v1", upgraded: null }, | ||
nodesData: { nodeIndexes: [] }, | ||
nodesData: { nodeIndexes: result.nodesData.nodeIndexes }, | ||
}); | ||
}); | ||
|
||
|
@@ -197,7 +197,7 @@ describe("torus utils cyan", function () { | |
}, | ||
hashedIdToken.substring(2) | ||
); | ||
|
||
delete result.sessionData; | ||
expect(result.oAuthKeyData.evmAddress).to.be.equal("0x34117FDFEFBf1ad2DFA6d4c43804E6C710a6fB04"); | ||
expect(result.finalKeyData.evmAddress).to.be.equal("0x34117FDFEFBf1ad2DFA6d4c43804E6C710a6fB04"); | ||
expect(result).eql({ | ||
|
@@ -213,9 +213,8 @@ describe("torus utils cyan", function () { | |
Y: "e557a5ee879632727f5979d6b9cea69d87e3dab54a8c1b6685d86dfbfcd785dd", | ||
privKey: "45a5b62c4ff5490baa75d33bf4f03ba6c5b0095678b0f4055312eef7b780b7bf", | ||
}, | ||
sessionData: { sessionTokenData: [], sessionAuthKey: "" }, | ||
metadata: { pubNonce: undefined, nonce: new BN(0), typeOfUser: "v1", upgraded: null }, | ||
nodesData: { nodeIndexes: [] }, | ||
nodesData: { nodeIndexes: result.nodesData.nodeIndexes }, | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters