-
Notifications
You must be signed in to change notification settings - Fork 334
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
bug: stdJson readBytes cannot handle 20-byte values #592
Comments
Do you know if this was always the case, or was there a regression in foundry or forge-std? The reverting values are actually 20 bytes long (40 hex chars), so my guess is that it's getting parsed as an address cc @mattsse to assign someone to look into this :) |
Regression. The test suite where we ran into this issue passed on an earlier version of
Yeah exactly, typo; fixed. & yes: I think something internal is automatically parsing 20-byte hex as an address. If true, it's very similar to the the last bug we found in Foundry JSON handling: foundry-rs/foundry#5808 Maybe a root cause fix: no automatic type inference. Users of |
Looks like this is only happening on older forge-std versions forge-std 1.2.0 does |
Summary
stdJson appears to be broken in latest forge-std. Reading 20-byte values with
readBytes(json, path)
returns incorrect results or reverts.Versions
forge-std: v1.2.0
Minimal reproduction
The text was updated successfully, but these errors were encountered: