From 42dc991c26a7810db0b5de833c4107fbe5ba0aaf Mon Sep 17 00:00:00 2001 From: larry <26318510+larry0x@users.noreply.github.com> Date: Mon, 19 Sep 2022 02:43:46 +0100 Subject: [PATCH] update tests reflecting the previous two changes --- contracts/hub/tests/creating.rs | 8 ++++---- contracts/hub/tests/deployment.rs | 11 +++++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/contracts/hub/tests/creating.rs b/contracts/hub/tests/creating.rs index 796a060..994d771 100644 --- a/contracts/hub/tests/creating.rs +++ b/contracts/hub/tests/creating.rs @@ -107,7 +107,7 @@ fn creating_badge() { vec![ attr("action", "badges/hub/create_badge"), attr("id", "1"), - attr("fee", ""), + attr("fee", "[]"), ] ); @@ -140,7 +140,7 @@ fn creating_badge() { vec![ attr("action", "badges/hub/create_badge"), attr("id", "2"), - attr("fee", ""), + attr("fee", "[]"), ] ); @@ -186,7 +186,7 @@ fn editing_badge() { vec![ attr("action", "badges/hub/edit_badge"), attr("id", "1"), - attr("fee", ""), + attr("fee", "[]"), ], ); @@ -281,7 +281,7 @@ fn adding_keys() { vec![ attr("action", "badges/hub/add_keys"), attr("id", "1"), - attr("fee", ""), + attr("fee", "[]"), attr("keys_added", "2"), ], ); diff --git a/contracts/hub/tests/deployment.rs b/contracts/hub/tests/deployment.rs index 8fd77c6..db41b0e 100644 --- a/contracts/hub/tests/deployment.rs +++ b/contracts/hub/tests/deployment.rs @@ -1,5 +1,5 @@ use cosmwasm_std::testing::{mock_dependencies}; -use cosmwasm_std::{attr, Addr, Decimal}; +use cosmwasm_std::{attr, Addr, Decimal, SubMsg, WasmMsg, to_binary}; use badge_hub::error::ContractError; use badge_hub::state::{BADGE_COUNT, NFT, DEVELOPER}; @@ -51,7 +51,14 @@ fn setting_nft() { // developer sets nft { let res = execute::set_nft(deps.as_mut(), Addr::unchecked("larry"), "nft").unwrap(); - assert_eq!(res.messages, vec![]); + assert_eq!( + res.messages, + vec![SubMsg::new(WasmMsg::Execute { + contract_addr: "nft".to_string(), + msg: to_binary(&badges::nft::ExecuteMsg::_Ready {}).unwrap(), + funds: vec![] + })], + ); assert_eq!( res.attributes, vec![