Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix up env_access api
  • Loading branch information
ascjones committed Jun 26, 2020
commit 9b5c99cc857468c87aa2574d8b96d8742feacb5c
2 changes: 1 addition & 1 deletion core/src/env/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ where
})
}

/// Returns the price for the specified amount of weight.
/// Returns the price for the specified amount of gas.
///
/// # Errors
///
Expand Down
2 changes: 1 addition & 1 deletion core/src/env/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pub trait TypedEnv: Env {
/// For more details visit: [`ink_core::env::transferred_balance`]
fn transferred_balance<T: EnvTypes>(&mut self) -> Result<T::Balance>;

/// Returns the price for the specified amount of weight.
/// Returns the price for the specified amount of gas.
///
/// # Note
///
Expand Down
6 changes: 3 additions & 3 deletions lang/src/env_access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ where
env::transferred_balance::<T>().expect("couldn't decode transferred balance")
}

/// Returns the current price for gas.
/// Returns the price for the specified amount of gas.
///
/// # Note
///
/// For more details visit: [`ink_core::env::gas_price`]
pub fn gas_price(self) -> T::Balance {
env::gas_price::<T>().expect("couldn't decode gas price")
pub fn gas_price(self, gas: u64) -> T::Balance {
env::gas_price::<T>(gas).expect("couldn't decode gas price")
}

/// Returns the amount of gas left for the contract execution.
Expand Down