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

BigInt.toHex() generates odd-length hex strings #1563

Open
rellfy opened this issue Jan 17, 2024 · 2 comments
Open

BigInt.toHex() generates odd-length hex strings #1563

rellfy opened this issue Jan 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@rellfy
Copy link

rellfy commented Jan 17, 2024

Which packages are impacted by your issue?

@graphprotocol/graph-ts

Describe the issue

BigInt.toHex on an address that starts with a single 0 will return an odd-length hex string.
This does not match the behaviour of Address.toHex for example, which can cause problems.
It will also therefore fail if inputting the result into Bytes.fromHexString.

Expected behavior

BigInt.toHex should always return even-length hex strings

Platform

@graphprotocol/graph-ts 0.31.0

@rellfy rellfy added the bug Something isn't working label Jan 17, 2024
@azf20
Copy link
Contributor

azf20 commented Feb 2, 2024

thanks @rellfy - @saihaj any ideas on this one - is this an issue with our implementation or a dependency?

@saihaj
Copy link
Member

saihaj commented Feb 2, 2024

thanks @rellfy - @saihaj any ideas on this one - is this an issue with our implementation or a dependency?

started an internal discussion with @leoyvens and likely it is something we investigate in graph-node cause graph-ts is just a types wrapper to host functions graph-node provides to WASM runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

3 participants