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§
Sourceconst GAS_PRICE_FLOOR: u8 = 1u8
const GAS_PRICE_FLOOR: u8 = 1u8
The minimum allowed gas price (aka the floor).
Required Associated Types§
Required Methods§
Sourcefn gas_cost(
&self,
chainspec: &Chainspec,
gas_price: u8,
) -> Result<Motes, Self::Error>
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.
Sourcefn gas_limit(&self, chainspec: &Chainspec) -> Result<Gas, Self::Error>
fn gas_limit(&self, chainspec: &Chainspec) -> Result<Gas, Self::Error>
Returns the gas / computation limit prior to execution.
Sourcefn gas_price_tolerance(&self) -> Result<u8, Self::Error>
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.