pub struct GasConsumer<'l> { /* private fields */ }
Expand description
Gas tracking context.
Implementations§
Source§impl<'l> GasConsumer<'l>
impl<'l> GasConsumer<'l>
pub const BUILD_CELL_GAS: u64 = 500u64
pub const NEW_CELL_GAS: u64 = 100u64
pub const OLD_CELL_GAS: u64 = 25u64
pub const FREE_STACK_DEPTH: usize = 32usize
pub const FREE_SIGNATURE_CHECKS: usize = 10usize
pub const CHEAP_GET_BALANCE_CALLS: usize = 5usize
pub const CHEAP_GET_BALANCE_GAS_THRESHOLD: u64 = 200u64
pub const FREE_NESTED_CONT_JUMP: usize = 8usize
pub const STACK_VALUE_GAS_PRICE: u64 = 1u64
pub const TUPLE_ENTRY_GAS_PRICE: u64 = 1u64
pub const HASH_EXT_ENTRY_GAS_PRICE: u64 = 1u64
pub const CHK_SGN_GAS_PRICE: u64 = 4_000u64
pub const IMPLICIT_JMPREF_GAS_PRICE: u64 = 10u64
pub const IMPLICIT_RET_GAS_PRICE: u64 = 5u64
pub const EXCEPTION_GAS_PRICE: u64 = 50u64
pub const RUNVM_GAS_PRICE: u64 = 40u64
pub fn new(params: GasParams) -> Self
pub fn with_libraries( params: GasParams, libraries: &'l dyn LibraryProvider, ) -> Self
pub fn limited(&'l self, remaining: u64) -> LimitedGasConsumer<'l>
pub fn derive( &mut self, params: GasConsumerDeriveParams, ) -> VmResult<ParentGasConsumer<'l>>
pub fn restore(&mut self, parent: ParentGasConsumer<'l>) -> RestoredGasConsumer
pub fn libraries(&self) -> &'l dyn LibraryProvider
pub fn credit(&self) -> u64
pub fn consumed(&self) -> u64
pub fn free_gas_consumed(&self) -> u64
pub fn remaining(&self) -> i64
pub fn base(&self) -> u64
pub fn limit(&self) -> u64
pub fn set_limit(&self, limit: u64)
pub fn price(&self) -> u64
pub fn try_get_extra_balance_consumer( &'l self, ) -> Option<LimitedGasConsumer<'l>>
pub fn try_consume_exception_gas(&self) -> Result<(), Error>
pub fn try_consume_implicit_jmpref_gas(&self) -> Result<(), Error>
pub fn try_consume_implicit_ret_gas(&self) -> Result<(), Error>
pub fn try_consume_check_signature_gas(&self) -> Result<(), Error>
pub fn try_consume_stack_gas( &self, stack: Option<&SafeRc<Stack>>, ) -> Result<(), Error>
pub fn try_consume_tuple_gas(&self, tuple_len: u64) -> Result<(), Error>
pub fn try_consume_stack_depth_gas(&self, depth: usize) -> Result<(), Error>
pub fn try_consume(&self, amount: u64) -> Result<(), Error>
pub fn consume_free_gas(&self, amount: u64)
pub fn missing_library(&self) -> Option<HashBytes>
pub fn set_missing_library(&self, hash: &HashBytes)
pub fn load_cell_as_slice( &self, cell: Cell, mode: LoadMode, ) -> Result<OwnedCellSlice, Error>
Trait Implementations§
Source§impl CellContext for GasConsumer<'_>
impl CellContext for GasConsumer<'_>
Auto Trait Implementations§
impl<'l> !Freeze for GasConsumer<'l>
impl<'l> !RefUnwindSafe for GasConsumer<'l>
impl<'l> !Send for GasConsumer<'l>
impl<'l> !Sync for GasConsumer<'l>
impl<'l> Unpin for GasConsumer<'l>
impl<'l> !UnwindSafe for GasConsumer<'l>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more