mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-24 17:07:58 +00:00
Tidy up some metadata accessing (#978)
* Reduce some repetition when obtaining metadata pallets/runtime_traits * make them pub * fix docs and clippy
This commit is contained in:
@@ -154,11 +154,7 @@ impl std::fmt::Display for ModuleError {
|
||||
impl ModuleError {
|
||||
/// Return more details about this error.
|
||||
pub fn details(&self) -> Result<ModuleErrorDetails, MetadataError> {
|
||||
let pallet = self
|
||||
.metadata
|
||||
.pallet_by_index(self.raw.pallet_index)
|
||||
.ok_or(MetadataError::PalletIndexNotFound(self.raw.pallet_index))?;
|
||||
|
||||
let pallet = self.metadata.pallet_by_index_err(self.raw.pallet_index)?;
|
||||
let variant = pallet
|
||||
.error_variant_by_index(self.raw.error[0])
|
||||
.ok_or_else(|| MetadataError::VariantIndexNotFound(self.raw.error[0]))?;
|
||||
|
||||
Reference in New Issue
Block a user