You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be really convenient to be able to set default values in the JSON parsing helpers with a third argument that return the default value when the key is not present in the passed in JSON string.
This would be similar to the UX of vm.envOr which reads an env var and then returns the default value if it doesn't exist. I am not particular about using overloading or following the Or suffix naming scheme. This would prevent parsing errors for when keys are not present in the JSON. I think it could be implemented by wrapping the low level vm JSON calls with try/catch
To facilitate #3782, we'll first add these overloads as native cheats first, then updating StdJson.sol in forge-std to have the appropriate read* wrapper methods
Component
Forge
Describe the feature you would like
Ref #8900:
To facilitate #3782, we'll first add these overloads as native cheats first, then updating
StdJson.sol
in forge-std to have the appropriateread*
wrapper methodscc @tynes
Additional context
No response
The text was updated successfully, but these errors were encountered: