Trait oasis_runtime_sdk::modules::core::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.

Object Safety§

This trait is not object safe.

Implementors§

source§

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

§

type Config = Cfg