Remove gas function from the public API (#1503)

* Disallow importing `gas` function

* Update srml/contract/src/wasm/prepare.rs

Co-Authored-By: pepyakin <s.pepyakin@gmail.com>
This commit is contained in:
Sergei Pepyakin
2019-01-21 16:21:32 +01:00
committed by Bastian Köcher
parent c2f7993d0f
commit 603392a9b9
2 changed files with 29 additions and 4 deletions
@@ -202,6 +202,9 @@ define_env!(Env, <E: Ext>,
// Account for used gas. Traps if gas used is greater than gas limit.
//
// NOTE: This is a implementation defined call and is NOT a part of the public API.
// This call is supposed to be called only by instrumentation injected code.
//
// - amount: How much gas is used.
gas(ctx, amount: u32) => {
charge_gas(&mut ctx.gas_meter, ctx.schedule, RuntimeToken::Explicit(amount))?;