Trait API

Source
pub trait API {
    type Config: Config;

Show 14 methods // Required methods fn use_batch_gas(gas: u64) -> Result<(), Error>; fn use_tx_gas(gas: u64) -> Result<(), Error>; fn remaining_batch_gas() -> u64; fn used_batch_gas() -> u64; fn remaining_tx_gas() -> u64; fn used_tx_gas() -> u64; fn max_batch_gas() -> u64; fn min_gas_price(denom: &Denomination) -> Option<u128>; fn set_priority(priority: u64); fn take_priority() -> u64; fn set_sender_meta(meta: SenderMeta); fn take_sender_meta() -> SenderMeta; fn estimate_gas_search_max_iters<C: Context>(ctx: &C) -> u64; fn has_epoch_changed() -> bool;
}
Expand description

Interface that can be called from other modules.

Required Associated Types§

Source

type Config: Config

Module configuration.

Required Methods§

Source

fn use_batch_gas(gas: u64) -> Result<(), Error>

Attempt to use gas. If the gas specified would cause either total used to exceed its limit, fails with Error::OutOfGas or Error::BatchOutOfGas, and neither gas usage is increased.

Source

fn use_tx_gas(gas: u64) -> Result<(), Error>

Attempt to use gas. If the gas specified would cause either total used to exceed its limit, fails with Error::OutOfGas or Error::BatchOutOfGas, and neither gas usage is increased.

Source

fn remaining_batch_gas() -> u64

Returns the remaining batch-wide gas.

Source

fn used_batch_gas() -> u64

Returns the total batch-wide gas used.

Source

fn remaining_tx_gas() -> u64

Return the remaining tx-wide gas.

Source

fn used_tx_gas() -> u64

Return the used tx-wide gas.

Source

fn max_batch_gas() -> u64

Configured maximum amount of gas that can be used in a batch.

Source

fn min_gas_price(denom: &Denomination) -> Option<u128>

Configured minimum gas price.

Source

fn set_priority(priority: u64)

Sets the transaction priority to the provided amount.

Source

fn take_priority() -> u64

Takes and returns the stored transaction priority.

Source

fn set_sender_meta(meta: SenderMeta)

Set transaction sender metadata.

Source

fn take_sender_meta() -> SenderMeta

Takes and returns the stored transaction sender metadata.

Source

fn estimate_gas_search_max_iters<C: Context>(ctx: &C) -> u64

Returns the configured max iterations in the binary search for the estimate gas.

Source

fn has_epoch_changed() -> bool

Check whether the epoch has changed since last processed block.

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§

Source§

impl<Cfg: Config> API for Module<Cfg>

Source§

type Config = Cfg