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§
Required Methods§
sourcefn use_batch_gas(gas: u64) -> Result<(), Error>
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.
sourcefn use_tx_gas(gas: u64) -> Result<(), Error>
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.
sourcefn remaining_batch_gas() -> u64
fn remaining_batch_gas() -> u64
Returns the remaining batch-wide gas.
sourcefn used_batch_gas() -> u64
fn used_batch_gas() -> u64
Returns the total batch-wide gas used.
sourcefn remaining_tx_gas() -> u64
fn remaining_tx_gas() -> u64
Return the remaining tx-wide gas.
sourcefn used_tx_gas() -> u64
fn used_tx_gas() -> u64
Return the used tx-wide gas.
sourcefn max_batch_gas() -> u64
fn max_batch_gas() -> u64
Configured maximum amount of gas that can be used in a batch.
sourcefn min_gas_price(denom: &Denomination) -> Option<u128>
fn min_gas_price(denom: &Denomination) -> Option<u128>
Configured minimum gas price.
sourcefn set_priority(priority: u64)
fn set_priority(priority: u64)
Sets the transaction priority to the provided amount.
sourcefn take_priority() -> u64
fn take_priority() -> u64
Takes and returns the stored transaction priority.
sourcefn set_sender_meta(meta: SenderMeta)
fn set_sender_meta(meta: SenderMeta)
Set transaction sender metadata.
sourcefn take_sender_meta() -> SenderMeta
fn take_sender_meta() -> SenderMeta
Takes and returns the stored transaction sender metadata.
sourcefn estimate_gas_search_max_iters<C: Context>(ctx: &C) -> u64
fn estimate_gas_search_max_iters<C: Context>(ctx: &C) -> u64
Returns the configured max iterations in the binary search for the estimate gas.
sourcefn has_epoch_changed() -> bool
fn has_epoch_changed() -> bool
Check whether the epoch has changed since last processed block.