Skip to content

Commit

Permalink
test: Use empty types for cw4 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abefernan committed Jul 19, 2024
1 parent 3e22c4d commit 6d4c93b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/interfaces/cw4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub trait Cw4 {

#[cfg(test)]
mod tests {
use cosmwasm_std::{from_json, to_json_binary};
use cosmwasm_std::{from_json, to_json_binary, Empty};

use super::sv::*;

Expand All @@ -96,7 +96,8 @@ mod tests {
let original_msg = Cw4QueryMsg::Admin {};

let serialized_msg = to_json_binary(&original_msg).unwrap();
let serialized_msg: Cw4QueryMsg = from_json(serialized_msg).unwrap();
let serialized_msg: Cw4QueryMsg<Empty, Empty, Empty, Empty, Empty> =
from_json(serialized_msg).unwrap();

assert_eq!(serialized_msg, original_msg);
}
Expand All @@ -115,7 +116,8 @@ mod tests {

#[test]
fn query_from_json() {
let deserialized: Cw4QueryMsg = from_json(br#"{"admin": {}}"#).unwrap();
let deserialized: Cw4QueryMsg<Empty, Empty, Empty, Empty, Empty> =
from_json(br#"{"admin": {}}"#).unwrap();
assert_eq!(deserialized, Cw4QueryMsg::Admin {});
}

Expand Down

0 comments on commit 6d4c93b

Please sign in to comment.