feat: add set_interval helper function (#1551)
This commit is contained in:
parent
9bf1bcb151
commit
e2754dee4f
|
@ -1286,11 +1286,18 @@ impl<P: JsonRpcClient> Provider<P> {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets the default polling interval for event filters and pending transactions
|
||||||
|
/// (default: 7 seconds)
|
||||||
|
pub fn set_interval<T: Into<Duration>>(&mut self, interval: T) -> &mut Self {
|
||||||
|
self.interval = Some(interval.into());
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
/// Sets the default polling interval for event filters and pending transactions
|
/// Sets the default polling interval for event filters and pending transactions
|
||||||
/// (default: 7 seconds)
|
/// (default: 7 seconds)
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn interval<T: Into<Duration>>(mut self, interval: T) -> Self {
|
pub fn interval<T: Into<Duration>>(mut self, interval: T) -> Self {
|
||||||
self.interval = Some(interval.into());
|
self.set_interval(interval);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue