Skip to content

Commit 8bf067d

Browse files
committed
fix: Optional Chaining for FactorEncs Access
1 parent cc7acc4 commit 8bf067d

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

src/mpcCoreKit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
12801280
this.checkReady();
12811281
const factorKeyPrivate = factorKeyCurve.keyFromPrivate(factorKey.toBuffer());
12821282
const factorPubX = factorKeyPrivate.getPublic().getX().toString("hex").padStart(64, "0");
1283-
const existingFactorEnc = this.tkey.metadata.factorEncs[this.tkey.tssTag][factorPubX];
1283+
const existingFactorEnc = this.tkey.metadata.factorEncs?.[this.tkey.tssTag]?.[factorPubX];
12841284
if (!existingFactorEnc) {
12851285
return false;
12861286
}

tests/gating.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ const variable: TestVariable[] = [
2323
description: "should not be gated when on devnet",
2424
web3AuthNetwork: WEB3AUTH_NETWORK.DEVNET,
2525
uxMode: "nodejs",
26-
// tkey tests seems use this verifierid, metadata retrun only have tkey that do not support tss
27-
email: defaultTestEmail + '1',
26+
email: defaultTestEmail,
2827
web3ClientID: "torus-key-test",
2928
expectedErrorThrown: false,
3029
},

tests/sessionTime.spec.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,7 @@ const defaultTestEmail = "testEmail1";
2323
const isBasePlan = (id: string) => id === "BCriFlI9ihm81N-bc7x6N-xbqwBLuxfRDMmSH87spKH27QTNOPj1W9s2K3-mp9NzXuaRiqxvAGHyuGlXG5wLD1g";
2424
// BasePlan up to 1 day only
2525
const variable: TestVariable[] = [
26-
{
27-
web3AuthNetwork: WEB3AUTH_NETWORK.DEVNET,
28-
uxMode: "nodejs",
29-
// tkey tests seems use this verifierid, metadata retrun only have tkey that do not support tss
30-
email: defaultTestEmail + "1",
31-
web3ClientID: "torus-key-test",
32-
sessionTime: 3600
33-
},
26+
{ web3AuthNetwork: WEB3AUTH_NETWORK.DEVNET, uxMode: "nodejs", email: defaultTestEmail, web3ClientID: "torus-key-test", sessionTime: 3600 },
3427
{
3528
web3AuthNetwork: WEB3AUTH_NETWORK.MAINNET,
3629
uxMode: "nodejs",

0 commit comments

Comments
 (0)