diff --git a/subxt/src/events/events_type.rs b/subxt/src/events/events_type.rs index 7efc7d93d40..aa07e4214a4 100644 --- a/subxt/src/events/events_type.rs +++ b/subxt/src/events/events_type.rs @@ -187,6 +187,12 @@ impl Events { self.find::().next().transpose() } + /// Iterate through the events using metadata to dynamically decode and skip + /// them, and return the last event found which decodes to the provided `Ev` type. + pub fn find_last(&self) -> Result, Error> { + self.find::().last().transpose() + } + /// Find an event that decodes to the type provided. Returns true if it was found. pub fn has(&self) -> Result { Ok(self.find::().next().transpose()?.is_some())