Skip to content

Commit ecbdae9

Browse files
committed
fix(multisig): update fallback logic in multisig import validation
- Modified the fallback mechanism to return an empty string when no aligned stake key is available, improving clarity in the validation process. - Ensured consistency in return values for stake key handling, aligning with the expected format.
1 parent de3e317 commit ecbdae9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/validateMultisigImport.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,10 @@ export async function validateMultisigImportPayload(payload: unknown): Promise<V
425425
if (m?.matched && typeof m.signerIndex === "number") {
426426
const idx = m.signerIndex;
427427
const hex = (signerStakeKeys[idx] || "").toLowerCase();
428-
return hex && /^[0-9a-f]{56}$/.test(hex) ? hex : (stakeSigKeyHashes[i] || "").toLowerCase();
428+
return hex && /^[0-9a-f]{56}$/.test(hex) ? hex : "";
429429
}
430-
// Fallback to stake script's key hash at same position, or empty string
431-
return (stakeSigKeyHashes[i] || "").toLowerCase();
430+
// Fallback to empty string when no aligned stake key is available
431+
return "";
432432
});
433433
// Recompute stakeAddressesUsed to stay positionally aligned with the reordered stake keys
434434
stakeAddressesUsedFinal = signerStakeKeysOrdered.map((hex) => {

0 commit comments

Comments
 (0)