Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Niederb committed Oct 24, 2024
1 parent 413c5e5 commit 838b581
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ impl<Hash: Encode + Decode> ExtrinsicReport<Hash> {
self.events = Some(events.into_iter().map(|event| event.to_raw()).collect());
}

/// Checks the status of the extrinsic by evaluating the events attached to the report.
/// Returns an error if the events are missing or if one of the events indicates a problem.
pub fn status_based_on_events(&self, metadata: &Metadata) -> Result<()> {
if self.events.is_none() {
return Err(Error::Other("Report does not contain any events".into()))
Expand Down

0 comments on commit 838b581

Please sign in to comment.