Skip to content

Commit 25fd3ed

Browse files
committed
fmt
1 parent f0e2ab0 commit 25fd3ed

File tree

2 files changed

+16
-37
lines changed

2 files changed

+16
-37
lines changed

local-tests/setup/networkContext.json

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8617,24 +8617,6 @@
86178617
"stateMutability": "nonpayable",
86188618
"type": "function"
86198619
},
8620-
{
8621-
"inputs": [
8622-
{
8623-
"internalType": "uint256",
8624-
"name": "realmId",
8625-
"type": "uint256"
8626-
},
8627-
{
8628-
"internalType": "uint256",
8629-
"name": "newTimeout",
8630-
"type": "uint256"
8631-
}
8632-
],
8633-
"name": "setPendingRejoinTimeout",
8634-
"outputs": [],
8635-
"stateMutability": "nonpayable",
8636-
"type": "function"
8637-
},
86388620
{
86398621
"inputs": [],
86408622
"name": "ActiveValidatorsCannotLeave",
@@ -9300,11 +9282,6 @@
93009282
"name": "port",
93019283
"type": "uint32"
93029284
},
9303-
{
9304-
"internalType": "address",
9305-
"name": "stakerAddress",
9306-
"type": "address"
9307-
},
93089285
{
93099286
"internalType": "uint256",
93109287
"name": "senderPubKey",
@@ -14619,4 +14596,4 @@
1461914596
],
1462014597
"name": "Ledger"
1462114598
}
14622-
}
14599+
}

packages/lit-node-client-nodejs/src/lib/helpers/parse-pkp-sign-response.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,31 @@ export const cleanStringValues = (obj: { [key: string]: any }): any =>
5252
export const parsePkpSignResponse = (
5353
responseData: PKPSignEndpointResponse[]
5454
): EcdsaSignedMessageShareParsed[] => {
55-
5655
const ecdsaSignedMessageShares = responseData.map(({ signatureShare }) => {
57-
5856
// Determine if the object is lifted or contains a nested structure
5957
// Example scenarios this logic handles:
60-
// 1. If `signatureShare` is nested (e.g., { EcdsaSignedMessageShare: { ... } }),
58+
// 1. If `signatureShare` is nested (e.g., { EcdsaSignedMessageShare: { ... } }),
6159
// it will extract the nested object (i.e., the value of `EcdsaSignedMessageShare`).
62-
// NOTE: against `f8047310fd4ac97ac01ff07a7cd1213808a3396e` in this case
60+
// NOTE: against `f8047310fd4ac97ac01ff07a7cd1213808a3396e` in this case
6361
// 2. If `signatureShare` is directly lifted (e.g., { digest: "...", result: "...", share_id: "..." }),
6462
// it will treat `signatureShare` itself as the resolved object.
65-
// NOTE: against `60318791258d273df8209b912b386680d25d0df3` in this case
66-
// 3. If `signatureShare` is null, not an object, or does not match expected patterns,
63+
// NOTE: against `60318791258d273df8209b912b386680d25d0df3` in this case
64+
// 3. If `signatureShare` is null, not an object, or does not match expected patterns,
6765
// it will throw an error later for invalid structure.
6866
const resolvedShare =
69-
typeof signatureShare === "object" &&
70-
!Array.isArray(signatureShare) &&
71-
Object.keys(signatureShare).length === 1 &&
72-
typeof signatureShare[Object.keys(signatureShare)[0] as keyof typeof signatureShare] === "object"
73-
? signatureShare[Object.keys(signatureShare)[0] as keyof typeof signatureShare]
67+
typeof signatureShare === 'object' &&
68+
!Array.isArray(signatureShare) &&
69+
Object.keys(signatureShare).length === 1 &&
70+
typeof signatureShare[
71+
Object.keys(signatureShare)[0] as keyof typeof signatureShare
72+
] === 'object'
73+
? signatureShare[
74+
Object.keys(signatureShare)[0] as keyof typeof signatureShare
75+
]
7476
: signatureShare;
7577

76-
if (!resolvedShare || typeof resolvedShare !== "object") {
77-
throw new Error("Invalid signatureShare structure.");
78+
if (!resolvedShare || typeof resolvedShare !== 'object') {
79+
throw new Error('Invalid signatureShare structure.');
7880
}
7981

8082
const camelCaseShare = convertKeysToCamelCase(resolvedShare);

0 commit comments

Comments
 (0)