mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 02:57:57 +00:00
Make TypeInfo for SkipCheckIfFeeless transparent, too (#2449)
The `SkipCheckifFeeless::IDENTIFIER` became transparent (ie was whatever the inner signed ext was). This PR just makes the `TypeInfo` transparent too, so that libraries that use said info to decode the data (ie subxt) can behave identically whether or not the `SkipCheckifFeeless` wrapper is used or not. --------- Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
@@ -40,7 +40,7 @@ use frame_support::{
|
||||
dispatch::{CheckIfFeeless, DispatchResult},
|
||||
traits::{IsType, OriginTrait},
|
||||
};
|
||||
use scale_info::TypeInfo;
|
||||
use scale_info::{StaticTypeInfo, TypeInfo};
|
||||
use sp_runtime::{
|
||||
traits::{DispatchInfoOf, PostDispatchInfoOf, SignedExtension},
|
||||
transaction_validity::TransactionValidityError,
|
||||
@@ -75,10 +75,17 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// A [`SignedExtension`] that skips the wrapped extension if the dispatchable is feeless.
|
||||
#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)]
|
||||
#[scale_info(skip_type_params(T))]
|
||||
#[derive(Encode, Decode, Clone, Eq, PartialEq)]
|
||||
pub struct SkipCheckIfFeeless<T, S>(pub S, sp_std::marker::PhantomData<T>);
|
||||
|
||||
// Make this extension "invisible" from the outside (ie metadata type information)
|
||||
impl<T, S: StaticTypeInfo> TypeInfo for SkipCheckIfFeeless<T, S> {
|
||||
type Identity = S;
|
||||
fn type_info() -> scale_info::Type {
|
||||
S::type_info()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, S: Encode> sp_std::fmt::Debug for SkipCheckIfFeeless<T, S> {
|
||||
#[cfg(feature = "std")]
|
||||
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
|
||||
|
||||
Reference in New Issue
Block a user