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.
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.