Skip to content

Commit

Permalink
Better async example (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayanski authored Nov 5, 2024
1 parent 6324eda commit 82c6bfe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cw-orch/examples/async_daemon.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use counter_contract::AsyncCounterQueryMsgFns;
use counter_contract::CounterContract;
use cw_orch_daemon::DaemonAsync;
use cw_orch_mock::Mock;

use cw_orch_daemon::DaemonAsync;
/// In order to use this script, you need to set the following env variables
///
/// RUST_LOG (recommended value `info`) to see the app logs
Expand All @@ -25,9 +25,12 @@ pub async fn main() -> anyhow::Result<()> {
.await?;

// Uploading a contract is very simple
let counter = CounterContract::new(Mock::new("sender"));
let counter = CounterContract::new(daemon.clone());
let upload_res = daemon.upload(&counter).await;
assert!(upload_res.is_ok());

let count = counter.get_count_async().await?;
assert_eq!(count.count, 1);

Ok(())
}

0 comments on commit 82c6bfe

Please sign in to comment.