@@ -7,9 +7,11 @@ use sylvia::{interface, schemars};
77
88#[ interface]
99#[ sv:: custom( msg=CustomMsgT , query=CustomQueryT ) ]
10- pub trait CustomAndGeneric < ExecT , QueryT , RetT , CustomMsgT , CustomQueryT >
10+ pub trait CustomAndGeneric < Exec1T , Exec2T , Exec3T , QueryT , RetT , CustomMsgT , CustomQueryT >
1111where
12- for < ' msg_de > ExecT : CustomMsg + Deserialize < ' msg_de > ,
12+ for < ' msg_de > Exec1T : CustomMsg + Deserialize < ' msg_de > ,
13+ Exec2T : sylvia:: types:: CustomMsg ,
14+ Exec3T : sylvia:: types:: CustomMsg ,
1315 QueryT : sylvia:: types:: CustomMsg ,
1416 RetT : CustomMsg + DeserializeOwned ,
1517 CustomMsgT : CustomMsg + DeserializeOwned ,
@@ -18,10 +20,19 @@ where
1820 type Error : From < StdError > ;
1921
2022 #[ msg( exec) ]
21- fn custom_generic_execute (
23+ fn custom_generic_execute_one (
2224 & self ,
2325 ctx : ExecCtx < CustomQueryT > ,
24- msgs : Vec < CosmosMsg < ExecT > > ,
26+ msgs1 : Vec < CosmosMsg < Exec1T > > ,
27+ msgs2 : Vec < CosmosMsg < Exec2T > > ,
28+ ) -> Result < Response < CustomMsgT > , Self :: Error > ;
29+
30+ #[ msg( exec) ]
31+ fn custom_generic_execute_two (
32+ & self ,
33+ ctx : ExecCtx < CustomQueryT > ,
34+ msgs1 : Vec < CosmosMsg < Exec2T > > ,
35+ msgs2 : Vec < CosmosMsg < Exec3T > > ,
2536 ) -> Result < Response < CustomMsgT > , Self :: Error > ;
2637
2738 #[ msg( query) ]
@@ -46,8 +57,14 @@ mod tests {
4657
4758 // Direct message construction
4859 let _ = super :: sv:: QueryMsg :: < _ , Empty > :: custom_generic_query ( SvCustomMsg { } ) ;
49- let _ = super :: sv:: ExecMsg :: custom_generic_execute ( vec ! [ CosmosMsg :: Custom ( SvCustomMsg { } ) ] ) ;
50- let _ = super :: sv:: ExecMsg :: custom_generic_execute ( vec ! [ CosmosMsg :: Custom ( SvCustomMsg { } ) ] ) ;
60+ let _ = super :: sv:: ExecMsg :: < _ , _ , SvCustomMsg > :: custom_generic_execute_one (
61+ vec ! [ CosmosMsg :: Custom ( SvCustomMsg { } ) ] ,
62+ vec ! [ CosmosMsg :: Custom ( SvCustomMsg { } ) ] ,
63+ ) ;
64+ let _ = super :: sv:: ExecMsg :: < SvCustomMsg , _ , _ > :: custom_generic_execute_two (
65+ vec ! [ CosmosMsg :: Custom ( SvCustomMsg { } ) ] ,
66+ vec ! [ CosmosMsg :: Custom ( SvCustomMsg { } ) ] ,
67+ ) ;
5168
5269 // Querier
5370 let deps = mock_dependencies ( ) ;
@@ -59,13 +76,40 @@ mod tests {
5976 let _: Result < SvCustomMsg , _ > = querier. custom_generic_query ( SvCustomMsg { } ) ;
6077
6178 // Construct messages with Interface extension
62- let _ =
63- <super :: sv:: Api < SvCustomMsg , _ , SvCustomMsg , SvCustomMsg , SvCustomQuery > as InterfaceApi >:: Query :: custom_generic_query (
64- SvCustomMsg { } ,
65- ) ;
66- let _=
67- <super :: sv:: Api < _ , SvCustomMsg , SvCustomMsg , cosmwasm_std:: Empty , SvCustomQuery > as InterfaceApi >:: Exec :: custom_generic_execute (
68- vec ! [ CosmosMsg :: Custom ( SvCustomMsg { } ) ,
69- ] ) ;
79+ let _ = <super :: sv:: Api <
80+ SvCustomMsg ,
81+ SvCustomMsg ,
82+ SvCustomMsg ,
83+ _ ,
84+ SvCustomMsg ,
85+ SvCustomMsg ,
86+ SvCustomQuery ,
87+ > as InterfaceApi >:: Query :: custom_generic_query ( SvCustomMsg { } ) ;
88+
89+ let _ = <super :: sv:: Api <
90+ _ ,
91+ _ ,
92+ SvCustomMsg ,
93+ SvCustomMsg ,
94+ SvCustomMsg ,
95+ cosmwasm_std:: Empty ,
96+ SvCustomQuery ,
97+ > as InterfaceApi >:: Exec :: custom_generic_execute_one (
98+ vec ! [ CosmosMsg :: Custom ( SvCustomMsg { } ) ] ,
99+ vec ! [ CosmosMsg :: Custom ( SvCustomMsg { } ) ] ,
100+ ) ;
101+
102+ let _ = <super :: sv:: Api <
103+ SvCustomMsg ,
104+ _ ,
105+ _ ,
106+ SvCustomMsg ,
107+ SvCustomMsg ,
108+ cosmwasm_std:: Empty ,
109+ SvCustomQuery ,
110+ > as InterfaceApi >:: Exec :: custom_generic_execute_two (
111+ vec ! [ CosmosMsg :: Custom ( SvCustomMsg { } ) ] ,
112+ vec ! [ CosmosMsg :: Custom ( SvCustomMsg { } ) ] ,
113+ ) ;
70114 }
71115}
0 commit comments