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: UINT comparison not working #151

Open
1 task done
mmackz opened this issue Oct 1, 2024 · 1 comment
Open
1 task done

fix: UINT comparison not working #151

mmackz opened this issue Oct 1, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mmackz
Copy link
Contributor

mmackz commented Oct 1, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

alpha.13

Current Behavior

When comparing UINT, the filterData has to be in hexadecimal form, and the fieldValue can be a bigInt.

For example, if we wanted to match a tokenId with the value of 3n, it would compare "0x03" with 3n which resolves to false.

Expected Behavior

Normalize the hexadecimal and field values so they can be compared properly.

Steps To Reproduce

Input a value as a hexadecimal string and have it compared to a field value that is a bigint.

CleanShot 2024-10-01 at 10 49 42@2x

Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)

No response

Anything else?

No response

@mmackz mmackz added the bug Something isn't working label Oct 1, 2024
@topocount topocount self-assigned this Oct 1, 2024
@sammccord
Copy link
Contributor

i think we should run everything through https://viem.sh/docs/utilities/fromHex based on the primitive type before comparing

@sammccord sammccord self-assigned this Oct 2, 2024
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
None yet
Development

No branches or pull requests

3 participants