Trait GasLimited

Source
pub trait GasLimited {
    type Error;

    const GAS_PRICE_FLOOR: u8 = 1u8;

    // Required methods
    fn gas_cost(
        &self,
        chainspec: &Chainspec,
        gas_price: u8,
    ) -> Result<Motes, Self::Error>;
    fn gas_limit(&self, chainspec: &Chainspec) -> Result<Gas, Self::Error>;
    fn gas_price_tolerance(&self) -> Result<u8, Self::Error>;
}
Available on crate feature std only.
Expand description

Calculates gas limit.

Provided Associated Constants§

Source

const GAS_PRICE_FLOOR: u8 = 1u8

The minimum allowed gas price (aka the floor).

Required Associated Types§

Source

type Error

The error type.

Required Methods§

Source

fn gas_cost( &self, chainspec: &Chainspec, gas_price: u8, ) -> Result<Motes, Self::Error>

Returns a gas cost based upon the gas_limit, the gas price, and the chainspec settings.

Source

fn gas_limit(&self, chainspec: &Chainspec) -> Result<Gas, Self::Error>

Returns the gas / computation limit prior to execution.

Source

fn gas_price_tolerance(&self) -> Result<u8, Self::Error>

Returns the gas price tolerance.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§