Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: react native buffer toString issue #153

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

ieow
Copy link
Contributor

@ieow ieow commented Jun 5, 2024

fix react-native toString issue on buffer return from subarray() function
#152

@@ -1200,7 +1200,8 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
}

if (tssPubKey.length === FIELD_ELEMENT_HEX_LEN + 1) {
tssPubKey = tssPubKey.subarray(1);
// Buffer is needed as react native buffer polyfill not able to polyfill subarray function
tssPubKey = Buffer.from(tssPubKey.subarray(1));
Copy link
Contributor

@matthiasgeihs matthiasgeihs Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I’m trying to understand what is the issue in more detail here. You state that subarray function is not available on react native polyfill, but you still use it here? How does wrapping with Buffer.from resolve the issue?

@ieow
Copy link
Contributor Author

ieow commented Jun 12, 2024

add issue reference
feross/buffer#329

@himanshuchawla009 himanshuchawla009 merged commit f0f12d1 into v3 Jun 12, 2024
1 check passed
@himanshuchawla009 himanshuchawla009 deleted the fix/react-native-buffer branch June 12, 2024 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants