Type Alias ConditionalOptions

pub type ConditionalOptions = TransactionConditional;
👎Deprecated since 0.8.4: use TransactionConditional instead
Expand description

Alias for backwards compat

Aliased Type§

struct ConditionalOptions {
    pub known_accounts: HashMap<Address, AccountStorage, FbBuildHasher<20>>,
    pub block_number_min: Option<u64>,
    pub block_number_max: Option<u64>,
    pub timestamp_min: Option<u64>,
    pub timestamp_max: Option<u64>,
}

Fields§

§known_accounts: HashMap<Address, AccountStorage, FbBuildHasher<20>>

A map of account addresses to their expected storage states. Each account can have a specified storage root or explicit slot-value pairs.

§block_number_min: Option<u64>

The minimal block number at which the transaction can be included. None indicates no minimum block number constraint.

§block_number_max: Option<u64>

The maximal block number at which the transaction can be included. None indicates no maximum block number constraint.

§timestamp_min: Option<u64>

The minimal timestamp at which the transaction can be included. None indicates no minimum timestamp constraint.

§timestamp_max: Option<u64>

The maximal timestamp at which the transaction can be included. None indicates no maximum timestamp constraint.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 104 bytes

Implementations

§

impl TransactionConditional

pub const fn has_exceeded_block_attributes( &self, block: &BlockConditionalAttributes, ) -> bool

Returns true if any configured block parameter (timestamp_max, block_number_max) are exceeded by the given block parameter.

E.g. the block parameter’s timestamp is higher than the configured block_number_max

pub const fn has_exceeded_block_number(&self, block_number: u64) -> bool

Returns true if the configured max block number is lower or equal to the given block_number

pub const fn has_exceeded_timestamp(&self, timestamp: u64) -> bool

Returns true if the configured max timestamp is lower or equal to the given timestamp

pub const fn matches_block_attributes( &self, block: &BlockConditionalAttributes, ) -> bool

Returns true if the transaction matches the given block attributes.

pub const fn matches_block_number(&self, block_number: u64) -> bool

Returns true if the transaction matches the given block number.

pub const fn matches_timestamp(&self, timestamp: u64) -> bool

Returns true if the transaction matches the given timestamp.

pub fn cost(&self) -> u64

Computes the aggregate cost of the preconditions; total number of storage lookups required

Trait Implementations

§

impl Clone for TransactionConditional

§

fn clone(&self) -> TransactionConditional

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
§

impl Debug for TransactionConditional

§

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

Formats the value using the given formatter. Read more
§

impl Default for TransactionConditional

§

fn default() -> TransactionConditional

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

impl<'de> Deserialize<'de> for TransactionConditional

§

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

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

impl PartialEq for TransactionConditional

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl Serialize for TransactionConditional

§

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

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

impl Eq for TransactionConditional

§

impl StructuralPartialEq for TransactionConditional