From c3a4f4a9270cc70a278e27530e60c0606a73bb86 Mon Sep 17 00:00:00 2001 From: abefernan <44572727+abefernan@users.noreply.github.com> Date: Fri, 19 Jul 2024 17:01:48 +0200 Subject: [PATCH] test: Use empty types for cw1 tests --- examples/interfaces/cw1/src/lib.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/interfaces/cw1/src/lib.rs b/examples/interfaces/cw1/src/lib.rs index 188318e2..8146a113 100644 --- a/examples/interfaces/cw1/src/lib.rs +++ b/examples/interfaces/cw1/src/lib.rs @@ -41,11 +41,13 @@ pub trait Cw1 { #[cfg(test)] mod tests { - use cosmwasm_std::{coins, from_json, to_json_binary, BankMsg}; + use cosmwasm_std::{coins, from_json, to_json_binary, BankMsg, Empty}; + + use crate::sv::{Cw1ExecMsg, Cw1QueryMsg}; #[test] fn execute() { - let original = super::sv::ExecMsg::Execute { + let original: Cw1ExecMsg = super::sv::ExecMsg::Execute { msgs: vec![BankMsg::Send { to_address: "receiver".to_owned(), amount: coins(10, "atom"), @@ -61,13 +63,13 @@ mod tests { #[test] fn execute_from_json() { - let deserialized = from_json(br#"{"execute": { "msgs": [] }}"#).unwrap(); + let deserialized: Cw1ExecMsg = from_json(br#"{"execute": { "msgs": [] }}"#).unwrap(); assert_eq!(super::sv::ExecMsg::Execute { msgs: vec![] }, deserialized); } #[test] fn query() { - let original = super::sv::QueryMsg::CanExecute { + let original: Cw1QueryMsg = super::sv::QueryMsg::CanExecute { sender: "sender".to_owned(), msg: BankMsg::Send { to_address: "receiver".to_owned(), @@ -84,7 +86,7 @@ mod tests { #[test] fn query_from_json() { - let deserialized = from_json( + let deserialized: Cw1QueryMsg = from_json( br#"{"can_execute": { "sender": "address", "msg": {