Replace ffi
with stdJson
in constructCreate2Salt
function
#904
Closed
smol-ninja
started this conversation in
Ideas
Replies: 2 comments
-
This sounds like low-risk to me but happy to accept the change. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Related PRs: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
During our call with Rusty (from Cantina), he suggested us to avoid using
ffi
for the following reasons:ffi
allows executing any arbitrary command during foundry tests. This is what enabled us to usejq
cli to read value ofversion
frompackage.json
However, a safer solution is to use
stdJson
which allows us to readpackage.json
as a JSON object. This is an in-build cheat code in Foundry and doesn't require us to enableffi
. It also reduces our dependency fromjq
cli and reduces the number of lines required to create salt.The following function:
becomes
I've already implemented it in 2cc42e5 if we agree to go ahead with this.
Beta Was this translation helpful? Give feedback.
All reactions