Skip to content

Commit

Permalink
fix DispatchError display
Browse files Browse the repository at this point in the history
  • Loading branch information
helin6 committed Jul 27, 2023
1 parent fa3a3bb commit 8c78061
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions subxt/src/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ pub enum Error {
#[error("Metadata: {0}")]
MetadataDecoding(#[from] MetadataTryFromError),
/// Runtime error.
#[error("Runtime error: {0:?}")]
Runtime(#[from] DispatchError),
#[error("Runtime error: {}", .0.to_string())]
Runtime(DispatchError),
/// Error decoding to a [`crate::dynamic::Value`].
#[error("Error decoding into dynamic value: {0}")]
Decode(#[from] DecodeError),
Expand Down
2 changes: 1 addition & 1 deletion subxt/src/tx/tx_progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ impl<T: Config, C: OnlineClientT<T>> TxInBlock<T, C> {
if ev.pallet_name() == "System" && ev.variant_name() == "ExtrinsicFailed" {
let dispatch_error =
DispatchError::decode_from(ev.field_bytes(), self.client.metadata())?;
return Err(dispatch_error.into());
return Err(Error::Runtime(dispatch_error));
}
}

Expand Down

0 comments on commit 8c78061

Please sign in to comment.