Skip to content

Commit

Permalink
tests: some tests for query msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
wotori committed Jun 11, 2023
1 parent e4c20f4 commit 9002c08
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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(),
},
&[],
Expand All @@ -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")
Expand Down

0 comments on commit 9002c08

Please sign in to comment.