Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return full extrinsic information, even when xt has failed #617

Closed
haerdib opened this issue Jul 14, 2023 · 2 comments · Fixed by #725
Closed

Return full extrinsic information, even when xt has failed #617

haerdib opened this issue Jul 14, 2023 · 2 comments · Fixed by #725
Assignees
Labels
F8-newfeature Introduces a new feature Q3-substantial

Comments

@haerdib
Copy link
Contributor

haerdib commented Jul 14, 2023

We currently throw away all xt information if it has failed:

In function

async fn submit_and_watch_opaque_extrinsic_until(
&self,
encoded_extrinsic: &Bytes,
watch_until: XtStatus,
) -> Result<ExtrinsicReport<Self::Hash>> {
let mut report = self
.submit_and_watch_opaque_extrinsic_until_without_events(encoded_extrinsic, watch_until)
.await?;
if watch_until < XtStatus::InBlock {
return Ok(report)
}
let block_hash = report.block_hash.ok_or(Error::BlockHashNotFound)?;
let extrinsic_events =
self.fetch_events_for_extrinsic(block_hash, report.extrinsic_hash).await?;
// Ensure that the extrins has been successful. If not, return an error.
for event in &extrinsic_events {
event.check_if_failed()?;
}
report.events = Some(extrinsic_events);
Ok(report)
}

We only return the dispatch error if the xt has failed. This only tells us why the extrinsic has failed, but not the xt_hash, nor the events for it. Even though it has been fetched previously.

So I'm proposing to return an Error that returns all the information: see #616

@haerdib haerdib self-assigned this Jul 14, 2023
@haerdib haerdib removed their assignment Jul 24, 2023
@haerdib haerdib added the F8-newfeature Introduces a new feature label Nov 28, 2023
@haerdib haerdib self-assigned this Jan 29, 2024
@haerdib

This comment was marked as outdated.

@haerdib
Copy link
Contributor Author

haerdib commented Feb 23, 2024

closed by #725

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F8-newfeature Introduces a new feature Q3-substantial
Projects
None yet
1 participant