From c5a31937b2fdcf217d6caae6b9ee18a79e500e78 Mon Sep 17 00:00:00 2001 From: cyberhoward Date: Fri, 7 Jul 2023 22:47:32 +0200 Subject: [PATCH] clean up examples --- cw-orch/examples/daemon_test.rs | 8 ++------ cw-orch/examples/mock_test.rs | 10 +++++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/cw-orch/examples/daemon_test.rs b/cw-orch/examples/daemon_test.rs index da14f7dbd..8cafed894 100644 --- a/cw-orch/examples/daemon_test.rs +++ b/cw-orch/examples/daemon_test.rs @@ -18,16 +18,12 @@ pub fn main() { let runtime = Runtime::new().unwrap(); // We can now create a daemon. This daemon will be used to interact with the chain. - let res = Daemon::builder() + let daemon = Daemon::builder() // set the network to use .chain(networks::LOCAL_JUNO) .handle(runtime.handle()) .mnemonic(LOCAL_MNEMONIC) - .build(); - - let Some(daemon) = res.as_ref().ok() else { - panic!("Error: {}", res.err().unwrap()); - }; + .build().unwrap(); let counter = CounterContract::new("local:counter", daemon.clone()); diff --git a/cw-orch/examples/mock_test.rs b/cw-orch/examples/mock_test.rs index 56fd03090..525342a82 100644 --- a/cw-orch/examples/mock_test.rs +++ b/cw-orch/examples/mock_test.rs @@ -2,7 +2,7 @@ use cosmwasm_std::Addr; use counter_contract::{ contract::CounterContract, - msg::{ExecuteMsg, GetCountResponse, InstantiateMsg, QueryMsg}, + msg::{ExecuteMsg, GetCountResponse, InstantiateMsg, QueryMsg, ExecuteMsgFns, QueryMsgFns}, }; use cw_orch::prelude::{CwOrchExecute, CwOrchInstantiate, CwOrchQuery, CwOrchUpload, Mock}; @@ -14,14 +14,14 @@ pub fn main() { let contract_counter = CounterContract::new("mock:contract_counter", mock); let upload_res = contract_counter.upload(); - assert!(upload_res.is_ok()); + upload_res.unwrap(); let init_res = contract_counter.instantiate(&InstantiateMsg { count: 0 }, Some(&sender), None); - assert!(init_res.is_ok()); + init_res.unwrap(); let exec_res = contract_counter.execute(&ExecuteMsg::Increment {}, None); - assert!(exec_res.is_ok()); + exec_res.unwrap(); let query_res = contract_counter.query::(&QueryMsg::GetCount {}); - assert!(query_res.is_ok()); + assert_eq!(query_res.unwrap().count,1); }