diff --git a/crates/rooch/src/commands/move_cli/commands/integration_test.rs b/crates/rooch/src/commands/move_cli/commands/integration_test.rs index 752388789a..09e4ef56dc 100644 --- a/crates/rooch/src/commands/move_cli/commands/integration_test.rs +++ b/crates/rooch/src/commands/move_cli/commands/integration_test.rs @@ -16,7 +16,9 @@ use move_package::compilation::build_plan::BuildPlan; use move_package::source_package::layout::SourcePackageLayout; use moveos_types::addresses::MOVEOS_NAMED_ADDRESS_MAPPING; use once_cell::sync::Lazy; +use rooch_config::rooch_config_dir; use rooch_integration_test_runner; +use rooch_rpc_client::wallet_context::WalletContext; use std::collections::BTreeMap; use std::fmt::Display; use std::num::NonZeroUsize; @@ -133,7 +135,7 @@ pub struct IntegrationTest { } impl IntegrationTest { - pub fn execute(self, move_arg: Move) -> anyhow::Result<()> { + pub async fn execute(self, move_arg: Move) -> anyhow::Result<()> { let rerooted_path = { let path = match move_arg.package_path { Some(_) => move_arg.package_path, @@ -143,6 +145,9 @@ impl IntegrationTest { SourcePackageLayout::try_find_root(&path.as_ref().unwrap().canonicalize()?)? }; + let rooch_dir = rooch_config_dir().unwrap(); + let wallet_context = WalletContext::new(Some(rooch_dir.clone())).await.unwrap(); + // force move to rebuild all packages, so that we can use compile_driver to generate the full compiled program. let mut build_config = move_arg.build_config; let _ = self @@ -151,9 +156,7 @@ impl IntegrationTest { .map(|(key, value)| { build_config.additional_named_addresses.insert( key.clone(), - NumericalAddress::parse_str(value.as_str()) - .unwrap() - .into_inner(), + wallet_context.parse_account_arg(value.clone()).ok()?, ) }) .collect::>(); diff --git a/crates/rooch/src/commands/move_cli/mod.rs b/crates/rooch/src/commands/move_cli/mod.rs index fc7b6b9ac0..0c48a27fb5 100644 --- a/crates/rooch/src/commands/move_cli/mod.rs +++ b/crates/rooch/src/commands/move_cli/mod.rs @@ -117,6 +117,7 @@ impl CommandAction for MoveCli { MoveCommand::View(c) => c.execute_serialized().await, MoveCommand::IntegrationTest(c) => c .execute(move_args) + .await .map(|_| "Success".to_owned()) .map_err(RoochError::from), MoveCommand::Explain(c) => c