From ca961eab4cdf8464a4430193d1de60c2f014bf0b Mon Sep 17 00:00:00 2001 From: Alexey Date: Thu, 15 Mar 2018 12:51:56 +0300 Subject: [PATCH 1/2] Update runtime.rs --- ethcore/wasm/src/runtime.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ethcore/wasm/src/runtime.rs b/ethcore/wasm/src/runtime.rs index bc639bea116..6c4daae9001 100644 --- a/ethcore/wasm/src/runtime.rs +++ b/ethcore/wasm/src/runtime.rs @@ -305,8 +305,10 @@ impl<'a> Runtime<'a> { if self.gas_counter > self.gas_limit { return Err(Error::InvalidGasState); } Ok(self.gas_limit - self.gas_counter) } - - /// Charges gas for the current block of execution. Returns an error in case of running out of gas. + + /// General gas charging extern. + /// https://github.com/paritytech/wasm-utils#gas-counter-wasm-gas injects calls to this extern + /// to charge gas upfront. Returns an error in case of running out of gas. fn gas(&mut self, args: RuntimeArgs) -> Result<()> { let amount: u32 = args.nth_checked(0)?; if self.charge_gas(amount as u64) { From f9703b4b18a21fc146f068181198db6a765b85bd Mon Sep 17 00:00:00 2001 From: Alexey Date: Thu, 15 Mar 2018 13:01:08 +0300 Subject: [PATCH 2/2] Update runtime.rs --- ethcore/wasm/src/runtime.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/ethcore/wasm/src/runtime.rs b/ethcore/wasm/src/runtime.rs index 6c4daae9001..71fafd671e3 100644 --- a/ethcore/wasm/src/runtime.rs +++ b/ethcore/wasm/src/runtime.rs @@ -307,8 +307,6 @@ impl<'a> Runtime<'a> { } /// General gas charging extern. - /// https://github.com/paritytech/wasm-utils#gas-counter-wasm-gas injects calls to this extern - /// to charge gas upfront. Returns an error in case of running out of gas. fn gas(&mut self, args: RuntimeArgs) -> Result<()> { let amount: u32 = args.nth_checked(0)?; if self.charge_gas(amount as u64) {