Skip to content

Commit

Permalink
all celeste tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyapotti committed May 6, 2024
1 parent e57f297 commit debbfb4
Showing 1 changed file with 41 additions and 35 deletions.
76 changes: 41 additions & 35 deletions test/celeste.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ describe.only("torus utils celeste", function () {
const verifierDetails = { verifier, verifierId: TORUS_TEST_EMAIL };
const { torusNodeEndpoints } = await TORUS_NODE_MANAGER.getNodeDetails(verifierDetails);
const result = await torus.getPublicAddress(torusNodeEndpoints, verifierDetails);
expect(result.finalKeyData.evmAddress).to.equal("0xeC80FB9aB308Be1789Bd3f9317962D5505A4A242");
expect(result.finalKeyData.evmAddress).to.equal("0xC3115b9d6FaB99739b23DA9dfcBA47A4Ec4Cd113");
expect(result.metadata.serverTimeOffset).lessThan(20);
delete result.metadata.serverTimeOffset;

expect(result).eql({
oAuthKeyData: {
evmAddress: "0xeC80FB9aB308Be1789Bd3f9317962D5505A4A242",
X: "d1a99fbec9326f04687daea4261b15b68cc45671554d43e94529d62857bf236c",
Y: "085bc72609f474b7b80081ecdc92d0dca241327195c7655c7a35b601c1f93e8e",
X: "b89b9d66b247d7294a98616b95b7bfa1675aa85a1df4d89f2780283864f1b6e9",
Y: "65422a8ccd66e638899fc53497e468a9a0bf50d45c9cb85ae0ffcfc13f433ffb",
evmAddress: "0xC3115b9d6FaB99739b23DA9dfcBA47A4Ec4Cd113",
},
finalKeyData: {
evmAddress: "0xeC80FB9aB308Be1789Bd3f9317962D5505A4A242",
X: "d1a99fbec9326f04687daea4261b15b68cc45671554d43e94529d62857bf236c",
Y: "085bc72609f474b7b80081ecdc92d0dca241327195c7655c7a35b601c1f93e8e",
X: "b89b9d66b247d7294a98616b95b7bfa1675aa85a1df4d89f2780283864f1b6e9",
Y: "65422a8ccd66e638899fc53497e468a9a0bf50d45c9cb85ae0ffcfc13f433ffb",
evmAddress: "0xC3115b9d6FaB99739b23DA9dfcBA47A4Ec4Cd113",
},
metadata: {
pubNonce: undefined,
Expand All @@ -54,26 +54,26 @@ describe.only("torus utils celeste", function () {
});
});

it("should fetch user type and public address", async function () {
it.only("should fetch user type and public address", async function () {
const verifier = "tkey-google-celeste"; // any verifier
const verifierDetails = { verifier, verifierId: TORUS_TEST_EMAIL };
const { torusNodeEndpoints } = await TORUS_NODE_MANAGER.getNodeDetails(verifierDetails);
const result1 = await torus.getUserTypeAndAddress(torusNodeEndpoints, verifierDetails);
expect(result1.finalKeyData.evmAddress).to.equal("0xeC80FB9aB308Be1789Bd3f9317962D5505A4A242");
expect(result1.finalKeyData.evmAddress).to.equal("0xC3115b9d6FaB99739b23DA9dfcBA47A4Ec4Cd113");
expect(result1.metadata.typeOfUser).to.equal("v1");
expect(result1.metadata.serverTimeOffset).lessThan(20);
delete result1.metadata.serverTimeOffset;

expect(result1).eql({
oAuthKeyData: {
evmAddress: "0xeC80FB9aB308Be1789Bd3f9317962D5505A4A242",
X: "d1a99fbec9326f04687daea4261b15b68cc45671554d43e94529d62857bf236c",
Y: "085bc72609f474b7b80081ecdc92d0dca241327195c7655c7a35b601c1f93e8e",
X: "b89b9d66b247d7294a98616b95b7bfa1675aa85a1df4d89f2780283864f1b6e9",
Y: "65422a8ccd66e638899fc53497e468a9a0bf50d45c9cb85ae0ffcfc13f433ffb",
evmAddress: "0xC3115b9d6FaB99739b23DA9dfcBA47A4Ec4Cd113",
},
finalKeyData: {
evmAddress: "0xeC80FB9aB308Be1789Bd3f9317962D5505A4A242",
X: "d1a99fbec9326f04687daea4261b15b68cc45671554d43e94529d62857bf236c",
Y: "085bc72609f474b7b80081ecdc92d0dca241327195c7655c7a35b601c1f93e8e",
X: "b89b9d66b247d7294a98616b95b7bfa1675aa85a1df4d89f2780283864f1b6e9",
Y: "65422a8ccd66e638899fc53497e468a9a0bf50d45c9cb85ae0ffcfc13f433ffb",
evmAddress: "0xC3115b9d6FaB99739b23DA9dfcBA47A4Ec4Cd113",
},
metadata: {
pubNonce: undefined,
Expand All @@ -91,26 +91,29 @@ describe.only("torus utils celeste", function () {
verifier: v2Verifier,
verifierId: v2TestEmail,
});
expect(result2.finalKeyData.evmAddress).to.equal("0x69fB3A96016817F698a1279aE2d65F3916F3Db6F");
expect(result2.metadata.typeOfUser).to.equal("v1");
expect(result2.finalKeyData.evmAddress).to.equal("0x8d69CE354DA39413f205FdC8680dE1F3FBBb36e2");
expect(result2.metadata.typeOfUser).to.equal("v2");
delete result2.metadata.serverTimeOffset;

expect(result2).eql({
oAuthKeyData: {
evmAddress: "0x69fB3A96016817F698a1279aE2d65F3916F3Db6F",
X: "9180a724488c99d7639f886e1920598618c2e599481d71ffd9f602c8a856ff20",
Y: "c5da5c13fedf3a22964ab39afb871bff607479e2a5cb2e621608771b4276b44b",
X: "cfa646a2949ebe559205c5c407d734d1b6927f2ea5fbeabfcbc31ab9a985a336",
Y: "8f988eb8b59515293820aa38af172b153e8d25307db8d5f410407c20e062b6e6",
evmAddress: "0xda4afB35493094Dd2C05b186Ca0FABAD96491B21",
},
finalKeyData: {
evmAddress: "0x69fB3A96016817F698a1279aE2d65F3916F3Db6F",
X: "9180a724488c99d7639f886e1920598618c2e599481d71ffd9f602c8a856ff20",
Y: "c5da5c13fedf3a22964ab39afb871bff607479e2a5cb2e621608771b4276b44b",
X: "5962144e03b993b0e503eb4e6e0196427f9fc9472f0dfd1be2ca5d4939f91680",
Y: "f6e81f01f483110badab18371237d15834f9ecf31c3588c165dae32ec446ac38",
evmAddress: "0x8d69CE354DA39413f205FdC8680dE1F3FBBb36e2",
},
metadata: {
pubNonce: undefined,
pubNonce: {
X: "2f630074151394ba1f715986a9215f4e36c9f22fc264ff880ef6d162c1300aa8",
Y: "704cb63e5f7a291735c54e22242ef53673642ec1660da00f1abc2e7909da03d7",
},
nonce: new BN(0),
upgraded: false,
typeOfUser: "v1",
typeOfUser: "v2",
},
nodesData: { nodeIndexes: [] },
});
Expand All @@ -123,24 +126,27 @@ describe.only("torus utils celeste", function () {
});
delete result3.metadata.serverTimeOffset;

expect(result3.finalKeyData.evmAddress).to.equal("0x24aCac36F8A4bD93052207dA410dA71AF92258b7");
expect(result3.metadata.typeOfUser).to.equal("v1");
expect(result3.finalKeyData.evmAddress).to.equal("0x8108c29976C458e76f797AD55A3715Ce80a3fe78");
expect(result3.metadata.typeOfUser).to.equal("v2");
expect(result3).eql({
oAuthKeyData: {
evmAddress: "0x24aCac36F8A4bD93052207dA410dA71AF92258b7",
X: "95b242e13e394e252d9685bfc1937a2acfa25e0c5e1d37bfd5247879ae1468cc",
Y: "687a6754180aec931ff65e55a058032107df519334b2f5c6fb1fc5157620a219",
X: "0cc857201e6c304dd893b243e323fe95982e5a99c0994cf902efa2432a672eb4",
Y: "37a2f53c250b3e1186e38ece3dfcbcb23e325913038703531831b96d3e7b54cc",
evmAddress: "0xc8c4748ec135196fb482C761da273C31Ec48B099",
},
finalKeyData: {
evmAddress: "0x24aCac36F8A4bD93052207dA410dA71AF92258b7",
X: "95b242e13e394e252d9685bfc1937a2acfa25e0c5e1d37bfd5247879ae1468cc",
Y: "687a6754180aec931ff65e55a058032107df519334b2f5c6fb1fc5157620a219",
X: "e95fe2d595ade03f56d9c9a147fbb67705041704f147576fa4a8afbe7dc69470",
Y: "3e20e4b331466769c4dd78f4561bfb2849010b4005b09c2ed082380326724ebe",
evmAddress: "0x8108c29976C458e76f797AD55A3715Ce80a3fe78",
},
metadata: {
pubNonce: undefined,
pubNonce: {
X: "f8ff2c44cc0abf512d35b35c3c5cbc0eda700d49bc13b72c5492b0cdb2ca3619",
Y: "88fb3087cec269c8c39d25b04f15298d33712f13b0f9665821328dfc7a567afb",
},
nonce: new BN(0),
upgraded: false,
typeOfUser: "v1",
typeOfUser: "v2",
},
nodesData: { nodeIndexes: [] },
});
Expand Down

0 comments on commit debbfb4

Please sign in to comment.