From fddae579396144c374446b6f66019c66991f0588 Mon Sep 17 00:00:00 2001 From: code0xff Date: Fri, 13 Sep 2024 23:12:20 +0900 Subject: [PATCH] test: Refactor any_match_test --- frame/cosmos/types/src/macros.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/frame/cosmos/types/src/macros.rs b/frame/cosmos/types/src/macros.rs index 370075d..5bfeef3 100644 --- a/frame/cosmos/types/src/macros.rs +++ b/frame/cosmos/types/src/macros.rs @@ -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, @@ -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,