@@ -153,9 +153,9 @@ impl<A: BackendApi, S: Storage, Q: Querier> Environment<A, S, Q> {
153
153
} )
154
154
}
155
155
156
- pub fn set_global ( & mut self , a : Global , b : Global ) {
157
- self . global_remaining_points = Some ( a ) ;
158
- self . global_points_exhausted = Some ( b )
156
+ pub fn set_global ( & mut self , remain : Global , exhausted : Global ) {
157
+ self . global_remaining_points = Some ( remain ) ;
158
+ self . global_points_exhausted = Some ( exhausted )
159
159
}
160
160
161
161
pub fn debug_handler ( & self ) -> Option < Rc < RefCell < DebugHandlerFn > > > {
@@ -503,7 +503,7 @@ mod tests {
503
503
Store ,
504
504
Box < WasmerInstance > ,
505
505
) {
506
- let env = Environment :: new ( MockApi :: default ( ) , gas_limit) ;
506
+ let mut env = Environment :: new ( MockApi :: default ( ) , gas_limit) ;
507
507
508
508
let ( engine, module) = compile ( CONTRACT , & [ ] ) . unwrap ( ) ;
509
509
let mut store = make_store_with_engine ( engine, TESTING_MEMORY_LIMIT ) ;
@@ -533,6 +533,16 @@ mod tests {
533
533
let instance_ptr = NonNull :: from ( instance. as_ref ( ) ) ;
534
534
env. set_wasmer_instance ( Some ( instance_ptr) ) ;
535
535
env. set_gas_left ( & mut store, gas_limit) ;
536
+ let remaining_points = instance
537
+ . exports
538
+ . get_global ( "wasmer_metering_remaining_points" ) ;
539
+ let points_exhausted = instance
540
+ . exports
541
+ . get_global ( "wasmer_metering_points_exhausted" ) ;
542
+ env. set_global (
543
+ remaining_points. unwrap ( ) . clone ( ) ,
544
+ points_exhausted. unwrap ( ) . clone ( ) ,
545
+ ) ;
536
546
537
547
( env, store, instance)
538
548
}
0 commit comments