Struct ethcontract::transaction::confirm::ConfirmParams
source · pub struct ConfirmParams {
pub confirmations: usize,
pub poll_interval_min: Duration,
pub poll_interval_max: Duration,
pub poll_interval_factor: f32,
pub block_timeout: Option<usize>,
}
Expand description
A struct with the confirmation parameters.
Fields§
§confirmations: usize
The number of blocks to confirm the transaction with. This is the number of blocks mined on top of the block where the transaction was mined. This means that, for example, to just wait for the transaction to be mined, then the number of confirmations should be 0. Positive non-zero values indicate that extra blocks should be waited for on top of the block where the transaction was mined.
poll_interval_min: Duration
Minimal delay between consecutive eth_blockNumber
calls.
We wait for transaction confirmation by polling node for latest
block number. We use exponential backoff to control how often
we poll the node.
poll_interval_max: Duration
Maximal delay between consecutive eth_blockNumber
calls.
poll_interval_factor: f32
Factor, by which the delay between consecutive eth_blockNumber
calls is multiplied after each call.
block_timeout: Option<usize>
The maximum number of blocks to wait for a transaction to get confirmed.
Implementations§
source§impl ConfirmParams
impl ConfirmParams
sourcepub fn mined() -> Self
pub fn mined() -> Self
Create new confirmation parameters for just confirming that the transaction was mined but not confirmed with any extra blocks.
sourcepub fn with_confirmations(count: usize) -> Self
pub fn with_confirmations(count: usize) -> Self
Create new confirmation parameters from the specified number of extra blocks to wait for with the default poll interval.
sourcepub fn confirmations(self, confirmations: usize) -> Self
pub fn confirmations(self, confirmations: usize) -> Self
Set new value for confirmations
.
sourcepub fn poll_interval(self, min: Duration, max: Duration, factor: f32) -> Self
pub fn poll_interval(self, min: Duration, max: Duration, factor: f32) -> Self
Set new values for exponential backoff settings.
sourcepub fn poll_interval_min(self, poll_interval_min: Duration) -> Self
pub fn poll_interval_min(self, poll_interval_min: Duration) -> Self
Set new value for poll_interval_min
.
sourcepub fn poll_interval_max(self, poll_interval_max: Duration) -> Self
pub fn poll_interval_max(self, poll_interval_max: Duration) -> Self
Set new value for poll_interval_max
.
sourcepub fn poll_interval_factor(self, poll_interval_factor: f32) -> Self
pub fn poll_interval_factor(self, poll_interval_factor: f32) -> Self
Set new value for poll_interval_factor
.
sourcepub fn block_timeout(self, block_timeout: Option<usize>) -> Self
pub fn block_timeout(self, block_timeout: Option<usize>) -> Self
Set new value for block_timeout
.
Trait Implementations§
source§impl Clone for ConfirmParams
impl Clone for ConfirmParams
source§fn clone(&self) -> ConfirmParams
fn clone(&self) -> ConfirmParams
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more