Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
test: Refactor any_match_test
Browse files Browse the repository at this point in the history
  • Loading branch information
code0xff committed Sep 13, 2024
1 parent 3e3522c commit fddae57
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions frame/cosmos/types/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ mod tests {
cosmos::bank::v1beta1::MsgSend,
cosmwasm::wasm::v1::{MsgExecuteContract, MsgStoreCode},
prost::Name,
traits::Message,
Any,
};

#[test]
fn any_match_test() {
let any = Any { type_url: MsgSend::type_url(), value: MsgSend::default().encode_to_vec() };
let any = Any::from_msg(&MsgSend::default()).unwrap();
let result = any_match!(
any, {
MsgSend => any.type_url,
Expand All @@ -55,10 +54,7 @@ mod tests {
);
assert_eq!(result, MsgSend::type_url());

let any = Any {
type_url: MsgExecuteContract::type_url(),
value: MsgExecuteContract::default().encode_to_vec(),
};
let any = Any::from_msg(&MsgExecuteContract::default()).unwrap();
let result = any_match!(
any, {
MsgSend => any.type_url,
Expand Down

0 comments on commit fddae57

Please sign in to comment.