added at_latest (#900)

* added at_latest

* change some documentation

* remove inline
This commit is contained in:
Tadeo Hepperle authored and GitHub committed 2023-04-11 13:07:12 +02:00
1 parent a69b3e45e7
commit 3b9fd72b26
18 files changed
+83 -55

No files matched your search

+13
View File
@@ -37,6 +37,19 @@ where
/// runtime upgrade. You can attempt to retrieve events from older blocks,
/// but may run into errors attempting to work with them.
pub fn at(
&self,
block_hash: T::Hash,
) -> impl Future<Output = Result<Events<T>, Error>> + Send + 'static {
self.at_or_latest(Some(block_hash))
}
/// Obtain events at the latest block hash.
pub fn at_latest(&self) -> impl Future<Output = Result<Events<T>, Error>> + Send + 'static {
self.at_or_latest(None)
}
/// Obtain events at some block hash.
fn at_or_latest(
&self,
block_hash: Option<T::Hash>,
) -> impl Future<Output = Result<Events<T>, Error>> + Send + 'static {