1
1
use cosmwasm_std:: { Addr , Decimal , Validator } ;
2
+ use cw_multi_test:: { no_init, AppBuilder } ;
3
+ use mesh_apis:: virtual_staking_api:: sv:: mt:: VirtualStakingApiProxy ;
2
4
use sylvia:: multitest:: Proxy ;
3
5
4
6
use mesh_converter:: contract:: sv:: mt:: ConverterContractProxy ;
5
7
6
8
use crate :: contract;
7
9
use crate :: contract:: sv:: mt:: VirtualStakingContractProxy ;
8
- use crate :: contract:: sv:: ContractSudoMsg ;
9
10
10
11
const JUNO : & str = "ujuno" ;
11
12
@@ -29,6 +30,10 @@ struct SetupResponse<'a> {
29
30
virtual_staking : Proxy < ' a , MtApp , contract:: VirtualStakingContract < ' a > > ,
30
31
}
31
32
33
+ fn new_app ( ) -> App {
34
+ App :: new ( AppBuilder :: new_custom ( ) . build ( no_init) )
35
+ }
36
+
32
37
fn setup < ' a > ( app : & ' a App , args : SetupArgs < ' a > ) -> SetupResponse < ' a > {
33
38
let SetupArgs {
34
39
owner,
@@ -73,7 +78,7 @@ fn setup<'a>(app: &'a App, args: SetupArgs<'a>) -> SetupResponse<'a> {
73
78
74
79
#[ test]
75
80
fn instantiation ( ) {
76
- let app = App :: default ( ) ;
81
+ let app = new_app ( ) ;
77
82
78
83
let owner = "sunny" ; // Owner of the staking contract (i. e. the vault contract)
79
84
let admin = "theman" ;
@@ -114,9 +119,10 @@ fn instantiation() {
114
119
}
115
120
116
121
#[ test]
117
- #[ ignore] // FIXME: Enable / finish this test once custom query support is added to sylvia
122
+ // FIXME: Enable / finish this test once custom query support is added to sylvia
123
+ #[ ignore = "IBC Messages not supported yet" ]
118
124
fn valset_update_sudo ( ) {
119
- let app = App :: < MtApp > :: default ( ) ;
125
+ let app = new_app ( ) ;
120
126
121
127
let owner = "sunny" ; // Owner of the staking contract (i. e. the vault contract)
122
128
let admin = "theman" ;
@@ -154,8 +160,8 @@ fn valset_update_sudo() {
154
160
] ;
155
161
let rems = vec ! [ "cosmosval2" . to_string( ) ] ;
156
162
let tombs = vec ! [ "cosmosval3" . to_string( ) ] ;
157
- // See this as an example how we can make working directly with these genertaed enums nicer
158
- let inner = mesh_apis :: virtual_staking_api :: sv :: VirtualStakingApiSudoMsg :: handle_valset_update (
163
+
164
+ let res = virtual_staking . handle_valset_update (
159
165
Some ( adds) ,
160
166
Some ( rems) ,
161
167
None ,
@@ -164,12 +170,6 @@ fn valset_update_sudo() {
164
170
Some ( tombs) ,
165
171
None ,
166
172
) ;
167
- let msg = ContractSudoMsg :: VirtualStakingApi ( inner) ;
168
-
169
- let res = app
170
- . app_mut ( )
171
- . wasm_sudo ( virtual_staking. contract_addr , & msg)
172
- . unwrap ( ) ;
173
-
174
173
println ! ( "res: {:?}" , res) ;
174
+ res. unwrap ( ) ;
175
175
}
0 commit comments