mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 19:51:02 +00:00
contracts: Remove weight pre charging (#8976)
* Remove pre-charging for code size * Remove pre charging when reading values of fixed size * Add new versions of API functions that leave out parameters * Update CHANGELOG.md * Apply suggestions from code review Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * Add v1 for seal_set_rent_allowance * Remove unneeded trait bound Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
committed by
GitHub
parent
bc0520913d
commit
0cccd282a1
@@ -167,15 +167,6 @@ where
|
||||
self.gas_left = self.gas_left.saturating_add(adjustment).min(self.gas_limit);
|
||||
}
|
||||
|
||||
/// Refund previously charged gas back to the gas meter.
|
||||
///
|
||||
/// This can be used if a gas worst case estimation must be charged before
|
||||
/// performing a certain action. This way the difference can be refundend when
|
||||
/// the worst case did not happen.
|
||||
pub fn refund(&mut self, amount: ChargedAmount) {
|
||||
self.gas_left = self.gas_left.saturating_add(amount.0).min(self.gas_limit)
|
||||
}
|
||||
|
||||
/// Returns how much gas was used.
|
||||
pub fn gas_spent(&self) -> Weight {
|
||||
self.gas_limit - self.gas_left
|
||||
|
||||
Reference in New Issue
Block a user