pub struct GasConstants {
    pub global_memory_per_byte_cost: InternalGasUnits<GasCarrier>,
    pub global_memory_per_byte_write_cost: InternalGasUnits<GasCarrier>,
    pub min_transaction_gas_units: InternalGasUnits<GasCarrier>,
    pub large_transaction_cutoff: AbstractMemorySize<GasCarrier>,
    pub intrinsic_gas_per_byte: InternalGasUnits<GasCarrier>,
    pub maximum_number_of_gas_units: GasUnits<GasCarrier>,
    pub min_price_per_gas_unit: GasPrice<GasCarrier>,
    pub max_price_per_gas_unit: GasPrice<GasCarrier>,
    pub max_transaction_size_in_bytes: GasCarrier,
    pub gas_unit_scaling_factor: GasCarrier,
    pub default_account_size: AbstractMemorySize<GasCarrier>,
}

Fields§

§global_memory_per_byte_cost: InternalGasUnits<GasCarrier>

The cost per-byte read from global storage.

§global_memory_per_byte_write_cost: InternalGasUnits<GasCarrier>

The cost per-byte written to storage.

§min_transaction_gas_units: InternalGasUnits<GasCarrier>

The flat minimum amount of gas required for any transaction. Charged at the start of execution.

§large_transaction_cutoff: AbstractMemorySize<GasCarrier>

Any transaction over this size will be charged an additional amount per byte.

§intrinsic_gas_per_byte: InternalGasUnits<GasCarrier>

The units of gas that to be charged per byte over the large_transaction_cutoff in addition to min_transaction_gas_units for transactions whose size exceeds large_transaction_cutoff.

§maximum_number_of_gas_units: GasUnits<GasCarrier>

~5 microseconds should equal one unit of computational gas. We bound the maximum computational time of any given transaction at roughly 20 seconds. We want this number and MAX_PRICE_PER_GAS_UNIT to always satisfy the inequality that MAXIMUM_NUMBER_OF_GAS_UNITS * MAX_PRICE_PER_GAS_UNIT < min(u64::MAX, GasUnits::MAX) NB: The bound is set quite high since custom scripts aren’t allowed except from predefined and vetted senders.

§min_price_per_gas_unit: GasPrice<GasCarrier>

The minimum gas price that a transaction can be submitted with.

§max_price_per_gas_unit: GasPrice<GasCarrier>

The maximum gas unit price that a transaction can be submitted with.

§max_transaction_size_in_bytes: GasCarrier§gas_unit_scaling_factor: GasCarrier§default_account_size: AbstractMemorySize<GasCarrier>

Implementations§

Trait Implementations§

source§

impl Clone for GasConstants

source§

fn clone(&self) -> GasConstants

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GasConstants

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for GasConstants

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for GasConstants

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq<GasConstants> for GasConstants

source§

fn eq(&self, other: &GasConstants) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for GasConstants

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for GasConstants

source§

impl StructuralEq for GasConstants

source§

impl StructuralPartialEq for GasConstants

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,