From 9002c084d0c873266c7ff5b3e53ebeaa61fc9f63 Mon Sep 17 00:00:00 2001 From: Wotori Movako <10486621+wotori@users.noreply.github.com> Date: Mon, 12 Jun 2023 01:07:55 +0300 Subject: [PATCH] tests: some tests for query msgs --- src/contract.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/contract.rs b/src/contract.rs index fd46707..4166fd7 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -279,6 +279,7 @@ mod tests { }; use cosmwasm_std::{coins, Addr}; use cw_multi_test::{App, ContractWrapper, Executor}; + use crate::msg::GamePriceResp; #[test] fn play() { @@ -539,7 +540,7 @@ mod tests { arcade: "pacman".to_string(), admins: vec!["admin1".to_owned(), "admin2".to_owned()], max_top_score: 1, - price_peer_game: 1, + price_peer_game: 123, denom: "aconst".to_string(), }, &[], @@ -562,6 +563,18 @@ mod tests { .unwrap(); assert_eq!(resp, PrizePoolResp { prize_pool: 111 }); + let price: GamePriceResp = app + .wrap() + .query_wasm_smart(&addr, &QueryMsg::Price {}) + .unwrap(); + assert_eq!(price, GamePriceResp { price: 123 }); + + let price: GameCounterResp = app + .wrap() + .query_wasm_smart(&addr, &QueryMsg::GameCounter {}) + .unwrap(); + assert_eq!(price, GameCounterResp { game_counter: 1 }); + assert_eq!( app.wrap() .query_balance("user1", "aconst")