Skip to content

Commit

Permalink
test: fix flaky passkey tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ly0va committed Feb 10, 2025
1 parent 6579573 commit b56065f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/PasskeyModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SmartAccount, Wallet } from "zksync-ethers";
import { SsoAccount__factory, WebAuthValidator, WebAuthValidator__factory } from "../typechain-types";
import { ContractFixtures, getProvider, getWallet, LOCAL_RICH_WALLETS, logInfo, RecordedResponse } from "./utils";
import { base64UrlToUint8Array } from "zksync-sso/utils";
import { encodeAbiParameters, Hex, hexToBytes, toHex } from "viem";
import { encodeAbiParameters, Hex, hexToBytes, toHex, pad } from "viem";
import { randomBytes } from "crypto";
import { parseEther, ZeroAddress } from "ethers";

Expand Down Expand Up @@ -428,7 +428,14 @@ async function validateSignatureTest(
{ name: "clientDataJson", type: "string" },
{ name: "rs", type: "bytes32[2]" },
],
[toHex(authData), sampleClientString, [toHex(rNormalization(generatedSignature.r)), toHex(sNormalization(generatedSignature.s))]]
[
toHex(authData),
sampleClientString,
[
pad(toHex(rNormalization(generatedSignature.r))),
pad(toHex(sNormalization(generatedSignature.s)))
]
]
)
return await passkeyValidator.validateSignature(transactionHash, fatSignature);
}
Expand Down

0 comments on commit b56065f

Please sign in to comment.