mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 15:11:02 +00:00
[contracts] Adapt storage reading host functions to Weights V2 (#12976)
* update RuntimeCosts to Weights V2, update tests * improve docs * clearer naming and docs to compat_weight helper * Apply suggestions from code review Co-authored-by: Alexander Theißen <alex.theissen@me.com> * save before master merge * HostFnWeights to Weight * added to_weight! macro * Apply suggestions from code review Co-authored-by: Alexander Theißen <alex.theissen@me.com> * RuntimeCosts::ChainExtension to weight_v2 * chain extension to weight v2 Co-authored-by: Alexander Theißen <alex.theissen@me.com>
This commit is contained in:
@@ -153,8 +153,8 @@ impl<T: Config> GasMeter<T> {
|
||||
/// Returns `OutOfGas` if there is not enough gas or addition of the specified
|
||||
/// amount of gas has lead to overflow. On success returns `Proceed`.
|
||||
///
|
||||
/// NOTE that amount is always consumed, i.e. if there is not enough gas
|
||||
/// then the counter will be set to zero.
|
||||
/// NOTE that amount isn't consumed if there is not enough gas. This is considered
|
||||
/// safe because we always charge gas before performing any resource-spending action.
|
||||
#[inline]
|
||||
pub fn charge<Tok: Token<T>>(&mut self, token: Tok) -> Result<ChargedAmount, DispatchError> {
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user