Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
imx-mikhala committed Jul 1, 2024
1 parent aac022a commit 11230ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/passport/sdk/src/utils/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export const hexToString = async (hex: string) => {
if (!hex) return hex;

try {
// Ensures Buffer is available when using the browser bundle of the SDK
if (typeof window !== 'undefined' && !window.Buffer) {
// Use dynamic import to load Buffer
const bufferModule = await import('buffer');
window.Buffer = bufferModule.Buffer;
}
Expand Down
1 change: 1 addition & 0 deletions packages/passport/sdk/src/zkEvm/personalSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const personalSign = async ({
throw new JsonRpcError(RpcErrorCode.INVALID_PARAMS, 'personal_sign requires the signer to be the from address');
}

// Convert message into a string if it's a hex
const payload = await hexToString(message);
const { chainId } = await rpcProvider.detectNetwork();
flow.addEvent('endDetectNetwork');
Expand Down

0 comments on commit 11230ec

Please sign in to comment.