mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 23:21:06 +00:00
Introduce ModuleError struct (#10776)
* better partial eq impl * introduce module error * fmt * import module error * Apply suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * fixes * fmt Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -255,7 +255,7 @@ use sp_runtime::{
|
||||
InvalidTransaction, TransactionPriority, TransactionSource, TransactionValidity,
|
||||
TransactionValidityError, ValidTransaction,
|
||||
},
|
||||
DispatchError, PerThing, Perbill, RuntimeDebug, SaturatedConversion,
|
||||
DispatchError, ModuleError, PerThing, Perbill, RuntimeDebug, SaturatedConversion,
|
||||
};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
@@ -1579,7 +1579,7 @@ impl<T: Config> ElectionProvider for Pallet<T> {
|
||||
/// number.
|
||||
pub fn dispatch_error_to_invalid(error: DispatchError) -> InvalidTransaction {
|
||||
let error_number = match error {
|
||||
DispatchError::Module { error, .. } => error,
|
||||
DispatchError::Module(ModuleError { error, .. }) => error,
|
||||
_ => 0,
|
||||
};
|
||||
InvalidTransaction::Custom(error_number)
|
||||
|
||||
Reference in New Issue
Block a user