diff --git a/gcli/tests/cmd/program.rs b/gcli/tests/cmd/program.rs index 46c83bbfb22..d1e1594afa1 100644 --- a/gcli/tests/cmd/program.rs +++ b/gcli/tests/cmd/program.rs @@ -97,9 +97,10 @@ Metadata { #[test] fn test_command_program_metadata_works() -> Result<()> { + let node = common::dev()?; let meta = env::wasm_bin("demo_new_meta.meta.txt"); let args = Args::new("program").action("meta").meta(meta); - let result = common::gcli(Vec::::from(args)).expect("run gcli failed"); + let result = node.run(args)?; let stdout = result.stdout.convert(); assert_eq!( @@ -113,13 +114,14 @@ fn test_command_program_metadata_works() -> Result<()> { #[test] fn test_command_program_metadata_derive_works() -> Result<()> { let meta = env::wasm_bin("demo_new_meta.meta.txt"); + let node = common::dev()?; let args = Args::new("program") .action("meta") .meta(meta) .flag("--derive") .derive("Person"); - let result = common::gcli(Vec::::from(args)).expect("run gcli failed"); + let result = node.run(args)?; let stdout = result.stdout.convert(); let expected = "Person { surname: String, name: String }"; @@ -153,9 +155,10 @@ Exports { #[test] fn test_command_program_metawasm_works() -> Result<()> { + let node = common::dev()?; let meta = env::wasm_bin("demo_meta_state_v1.meta.wasm"); let args = Args::new("program").action("meta").meta(meta); - let result = common::gcli(Vec::::from(args)).expect("run gcli failed"); + let result = node.run(args)?; let stdout = result.stdout.convert(); assert_eq!( @@ -168,6 +171,7 @@ fn test_command_program_metawasm_works() -> Result<()> { #[test] fn test_command_program_metawasm_derive_works() -> Result<()> { + let node = common::dev()?; let meta = env::wasm_bin("demo_meta_state_v1.meta.wasm"); let args = Args::new("program") .action("meta") @@ -175,7 +179,7 @@ fn test_command_program_metawasm_derive_works() -> Result<()> { .flag("--derive") .derive("Person"); - let result = common::gcli(Vec::::from(args)).expect("run gcli failed"); + let result = node.run(args)?; let stdout = result.stdout.convert(); let expected = "Person { surname: String, name: String }"; diff --git a/gcli/tests/cmd/send.rs b/gcli/tests/cmd/send.rs index a1933576f03..83d8fb2020c 100644 --- a/gcli/tests/cmd/send.rs +++ b/gcli/tests/cmd/send.rs @@ -36,6 +36,7 @@ async fn test_command_send_works() -> Result<()> { // Send message to messager let dest = hex::encode(mailbox[0].0.source.0); let _ = node.run(Args::new("send").destination(dest).gas_limit("2000000000"))?; + let mailbox = signer .api() .mailbox(Some(common::alice_account_id()), 10) diff --git a/gcli/tests/common/mod.rs b/gcli/tests/common/mod.rs index dbbafc92d1c..78494bb3d1b 100644 --- a/gcli/tests/common/mod.rs +++ b/gcli/tests/common/mod.rs @@ -20,7 +20,7 @@ pub use self::{ args::Args, result::{Error, Result}, - traits::NodeExec, + traits::{Convert, NodeExec}, }; use gear_core::ids::{CodeId, ProgramId}; use gsdk::{ @@ -60,13 +60,14 @@ impl NodeExec for Node { /// Run binary `gcli` pub fn gcli(args: impl IntoIterator) -> Result { - Ok(Command::new(env::bin("gcli")) + Command::new(env::bin("gcli")) .args( args.into_iter() .map(|v| v.to_string()) .collect::>(), ) - .output()?) + .output() + .map_err(Into::into) } /// Run the dev node diff --git a/gcli/tests/common/node.rs b/gcli/tests/common/node.rs deleted file mode 100644 index 8b137891791..00000000000 --- a/gcli/tests/common/node.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/gcli/tests/common/result.rs b/gcli/tests/common/result.rs index ca23e82a260..aa2a5ab642e 100644 --- a/gcli/tests/common/result.rs +++ b/gcli/tests/common/result.rs @@ -18,6 +18,8 @@ #[derive(Debug, thiserror::Error)] pub enum Error { + #[error(transparent)] + Anyhow(#[from] anyhow::Error), #[error(transparent)] GCli(#[from] gcli::result::Error), #[error(transparent)] diff --git a/gsdk/src/signer/utils.rs b/gsdk/src/signer/utils.rs index 759d2477c63..84a568ef556 100644 --- a/gsdk/src/signer/utils.rs +++ b/gsdk/src/signer/utils.rs @@ -196,6 +196,7 @@ impl Inner { call: Call, fields: impl Into>, ) -> Result { + log::info!("Run tx: {}::{}", Call::PALLET, call.call_name()); let tx = subxt::dynamic::tx(Call::PALLET, call.call_name(), fields.into()); self.process(tx).await