-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Extract frame_system SignedExtensions into separate files. #6474
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Although might as well also move tests into a tests.rs
?
@shawntabrizi tests moved as well. |
|
||
/// Check for transaction mortality. | ||
#[derive(Encode, Decode, Clone, Eq, PartialEq)] | ||
pub struct CheckEra<T: Trait + Send + Sync>(Era, sp_std::marker::PhantomData<T>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we move this, can we may directly rename this?
And call it CheckMortality
to make it more obvious what this is doing? I first always think that this checks the era.
transaction_validity::{ | ||
ValidTransaction, TransactionValidityError, InvalidTransaction, TransactionValidity, | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TY!
This is fine - but let's not rush this through to the networks since it needs an API and extension rollout (with approvals). The signed extensions are used in there to make sense of the payload. |
CC @jacogr the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All ok.
All
SignedExtensions
offrame_system
used to be placed in one fileframe/system/src/lib.rs
together with the module implementation and the tests.The file became rather large over time and the code & tests mixed up.
The PR moves each extension to it's own module under
extensions
directory and moves corresponding tests there as well. The test initialisation code is extracted tomock.rs
file, similar to how otherpallets
are structured.I didn't change any logic, nor did it change any APIs (extensions are re-exported), it only introduced a bunch of changes necessary to make the code work with the new structure (
pub(crate)
, etc).Done because I want to change how weights are parametrized and realised that I'd need to add a bunch of new lines to this enormous file, so rather decided to split it first.
Polkadot Companion: paritytech/polkadot#1306