Skip to content
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

chore: add way to invoke cargo from go code in effort to reuse rust tests #967

Merged
merged 12 commits into from
Sep 23, 2023
6 changes: 5 additions & 1 deletion cmd/crates/soroban-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ impl TestEnv {
/// A convenience method for using the invoke command.
pub fn invoke<I: AsRef<str>>(&self, command_str: &[I]) -> Result<String, invoke::Error> {
let cmd = contract::invoke::Cmd::parse_arg_vec(
&command_str.iter().map(AsRef::as_ref).collect::<Vec<_>>(),
&command_str
.iter()
.map(AsRef::as_ref)
.filter(|s| !s.is_empty())
.collect::<Vec<_>>(),
)
.unwrap();
self.invoke_cmd(cmd)
Expand Down
Loading