Rust <-> Solidity Unit Testing #8765
JayWhite2357
started this conversation in
Ideas
Replies: 1 comment
-
Side note: you can silent out the script output using a "fake" shell, to keep tests a bit more clean: use foundry_common::shell::{ColorChoice, OutputFormat, OutputMode, Shell};
let shell = Shell::new_with(OutputFormat::Json, OutputMode::Quiet, ColorChoice::Never, 0);
shell.set(); But having a TestArgs::run_test() would be really nice imo:) |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
One thing that is particularly interesting for our project (and many others) is the ability to send data between Solidity and a Rust service.
Having the ability to unit test the combination of the two of these languages would be a powerful primitive. Here's what I have gotten to work for us.
It feels a bit hacky, and I'm sure there could be a much simpler integration done quite easily. One concrete request from my end is for
forge-script
to be published tocrates.io
in order for dependencies to resolve more easily, as this was, by far, the most difficult part.If anyone has suggestions on a better way of going about this, and if I'm missing something obvious here, I'm all ears. Perhaps revm+foundry-compilers is the correct way to do this, but I didn't see anything as immediately simple as forge-script.
TestScript.t.sol
sol_test.rs
Beta Was this translation helpful? Give feedback.
All reactions