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

js-xdr cannot works well in a pre-ES2016 environment. #117

Closed
overcat opened this issue Mar 8, 2024 · 1 comment · Fixed by #118
Closed

js-xdr cannot works well in a pre-ES2016 environment. #117

overcat opened this issue Mar 8, 2024 · 1 comment · Fixed by #118
Labels

Comments

@overcat
Copy link
Contributor

overcat commented Mar 8, 2024

Describe the bug
The new version of js-xdr uses Buffer.subarray, but currently it does not work properly in pre-ES2016 environments. This has caused the new version of stellar-sdk to be unable to be used in React Native, because React Native uses the default JS engine that supports ES6.

I suggest reading this thread to learn more information: feross/buffer#329 (comment)

What version are you on?
3.1.0

To Reproduce
Steps to reproduce the behavior:
Run the following code in the ES6 engine, for example, Hermes, it is the default engine for React Native projects.

console.log(new XDR.Hyper(0).toXDR("base64"))

Actual output

0,0,0,0,0,0,0,0

Expected output

AAAAAAAAAAA=

Expected behavior
Works well in a pre-ES2016 environment.
Additional context
N/A

@overcat overcat added the bug label Mar 8, 2024
@overcat overcat changed the title XDR objects cannot be correctly converted to base64 strings in pre-ES2016 environments. js-xdr cannot run in a pre-ES2016 environment. Mar 8, 2024
@overcat overcat changed the title js-xdr cannot run in a pre-ES2016 environment. js-xdr cannot works well in a pre-ES2016 environment. Mar 8, 2024
@overcat
Copy link
Contributor Author

overcat commented Mar 12, 2024

Hi @piyalbasu, I created a repo to reproduce this bug. You can run it if you need to.

repo: https://github.com/overcat/StellarSdkDebugApp
setup env: https://reactnative.dev/docs/environment-setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant