From 6fb3a66d26003f1420f93796d5a29c76a6749d10 Mon Sep 17 00:00:00 2001 From: Bruno Galvao Date: Thu, 21 Mar 2024 19:33:35 +0900 Subject: [PATCH] add anyhow:error --- src/engines/contract_engine.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engines/contract_engine.rs b/src/engines/contract_engine.rs index f26a93e9..6aeaa549 100644 --- a/src/engines/contract_engine.rs +++ b/src/engines/contract_engine.rs @@ -56,7 +56,7 @@ pub fn build_smart_contract(path: &Option) -> anyhow::Result<()> { Ok(()) } -pub fn test_smart_contract(path: &Option) -> anyhow::Result<()> { +pub fn (path: &Option) -> anyhow::Result<()> { cmd("cargo", vec!["test"]).dir(path.clone().unwrap_or("./".into())).run()?; Ok(()) @@ -174,7 +174,7 @@ mod tests { use std::path::PathBuf; use tempdir::TempDir; - fn setup_test_environment() -> Result> { + fn setup_test_environment() -> Result, anyhow::Error> { let temp_contract_dir = TempDir::new("test_folder")?; let result: anyhow::Result<()> = create_smart_contract("test".to_string(), &Some(PathBuf::from(temp_contract_dir.path()))); assert!(result.is_ok(), "Failed to create smart contract"); @@ -183,7 +183,7 @@ mod tests { } #[test] - fn test_create_smart_contract() -> Result<(), Box> { + fn test_create_smart_contract() -> Result, anyhow::Error> { let temp_contract_dir = setup_test_environment()?; // Verify that the generated smart contract contains the expected content @@ -196,7 +196,7 @@ mod tests { } #[test] - fn test_test_smart_contract() -> Result<(), Box> { + fn test_test_smart_contract() -> Result, anyhow::Error> { let temp_contract_dir = setup_test_environment()?; let result = test_smart_contract(&Some(temp_contract_dir.path().join("test")));