Skip to content

Commit

Permalink
Rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
Niederb committed Oct 28, 2024
1 parent 838b581 commit e5dcf75
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl<Hash: Encode + Decode> ExtrinsicReport<Hash> {

/// 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<()> {
pub fn check_events_for_dispatch_error(&self, metadata: &Metadata) -> Result<()> {
if self.events.is_none() {
return Err(Error::Other("Report does not contain any events".into()))
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/rpc_api/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ where
return Ok(report)
}
self.populate_events(&mut report).await?;
report.status_based_on_events(self.metadata())?;
report.check_events_for_dispatch_error(self.metadata())?;
return Ok(report);
}

Expand Down
4 changes: 2 additions & 2 deletions testing/async/examples/author_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ async fn test_submit_and_watch_extrinsic_until_in_block_without_events(
assert!(report.events.is_none());

// Should fail without events
assert!(report.status_based_on_events(&api.metadata()).is_err());
assert!(report.check_events_for_dispatch_error(&api.metadata()).is_err());

// Now we fetch the events separately
api.populate_events(&mut report).await.unwrap();
assert!(report.events.is_some());
assert!(report.status_based_on_events(&api.metadata()).is_ok());
assert!(report.check_events_for_dispatch_error(&api.metadata()).is_ok());
let events = report.events.as_ref().unwrap();
assert_associated_events_match_expected(&events);

Expand Down

0 comments on commit e5dcf75

Please sign in to comment.