-
Notifications
You must be signed in to change notification settings - Fork 224
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
noirc_abi
cannot parse negative integer strings from JSON
#6637
Comments
noirc_abi
cannot parse negative integer stringsnoirc_abi
cannot parse negative integer strings from JSON
I've scoped out the tests necessary in #6638 but I'd appreciate others taking this up. |
Oh, I started working on this before it was assigned to @guipublic . So far what I found is that
we are turning, say, Then the tests I'll try to send a PR if I manage to fix this. |
You've written the same expression as the code you're saying is incorrect but I would say that 255 is correct here as it's the two's complement of -1 which is how we represent signed integers. |
Oh, I see what you mean. I'll rollback that commit, or fix it and the fix the test. |
I think I got it right this time 🤞 |
Closed by #6638 |
I noticed that we're handling signed integers differently for JSON files compared to TOML.
noir/tooling/noirc_abi/src/input_parser/toml.rs
Lines 129 to 145 in 6167b73
noir/tooling/noirc_abi/src/input_parser/json.rs
Lines 146 to 158 in 6167b73
That is we don't have handling for negative integer strings in JSON. This means that the WASM ABI encoder can't handle these inputs which is bad.
We currently have proptests for ABI encoding but we should probably extend these to cover the input parsing and fix any issues which arise.
The text was updated successfully, but these errors were encountered: