Просмотр исходного кода

wasm: re-enable metering for gas used

x 3 лет назад
Родитель
Сommit
e5ca71bd4b
1 измененных файлов с 2 добавлено и 6 удалено
  1. 2 6
      src/runtime/vm_runtime.rs

+ 2 - 6
src/runtime/vm_runtime.rs

@@ -212,10 +212,8 @@ impl Runtime {
         }
     }
 
-    fn gas_info(&self) -> String {
-        // DISABLED
-        /*
-        let remaining_points = get_remaining_points(&self.instance);
+    fn gas_info(&mut self) -> String {
+        let remaining_points = get_remaining_points(&mut self.store, &self.instance);
 
         match remaining_points {
             MeteringPoints::Remaining(rem) => {
@@ -225,8 +223,6 @@ impl Runtime {
                 format!("Gas fully exhausted: {}/{}", GAS_LIMIT + 1, GAS_LIMIT)
             }
         }
-        */
-        "(gas info temporarily disabled)".to_string()
     }
 
     /// Set the memory page size