-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Upgrade authorship pallet to Frame-v2 #8663
Conversation
relates #7882 |
|
I believe it needs a polkadot companion pr to add Authorship to certain mocks |
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
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.
can you put this message #8663 (comment) in the top message
And also add that the pallet needs to be part of the pallets in construct_runtime to work properly, thus tests might need to be changed.
Otherwise it looks good to me, but it needs a companion PR on polkadot
@@ -194,50 +173,86 @@ decl_module! { | |||
Self::prune_old_uncles(minimum_height) | |||
} | |||
|
|||
<Self as Store>::DidSetUncles::put(false); | |||
<DidSetUncles<T>>::put(false); |
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.
We can still use the trait Store, but I'm fine with the change too.
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.
yeah I realized that after I already changed them ¯_(ツ)_/¯
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.
In general I prefer the syntax like DidSetUncles::<T>::put(false)
, but its all the same.
@@ -52,6 +52,7 @@ frame_support::construct_runtime!( | |||
UncheckedExtrinsic = UncheckedExtrinsic, | |||
{ | |||
System: frame_system::{Pallet, Call, Config, Storage, Event<T>}, | |||
Authorship: pallet_authorship::{Pallet, Call, Storage, Inherent}, |
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.
This is not used as far as I can see. If so, You should remove the impl
block rather than adding it here.
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.
pallet authorship is used in the equivocation handler (equivocation handler used in the mock requires pallet authorship)
@@ -52,6 +52,7 @@ frame_support::construct_runtime!( | |||
UncheckedExtrinsic = UncheckedExtrinsic, | |||
{ | |||
System: frame_system::{Pallet, Call, Config, Storage, Event<T>}, | |||
Authorship: pallet_authorship::{Pallet, Call, Storage, Inherent}, |
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.
ditto
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.
same used for equivocation handler
@@ -96,6 +96,7 @@ frame_support::construct_runtime!( | |||
UncheckedExtrinsic = UncheckedExtrinsic, | |||
{ | |||
System: frame_system::{Pallet, Call, Config, Storage, Event<T>}, | |||
Authorship: pallet_authorship::{Pallet, Call, Storage, Inherent}, |
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.
Ditto
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.
it is used in tests to note uncles and check the reward points I think
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.
And also add that the pallet needs to be part of the pallets in construct_runtime to work properly, thus tests might need to be changed.
I'm a bit confused about this, but I suppose it is my mistake. LGTM otherwise.
pallet which are implemented for a runtime needs to be part of construct_runtime in order to have the pallet info accessible. |
bot merge |
Trying merge. |
* first commit * get to compile * fix deprecated grandpa * formatting * module to pallet * add authorship pallet to mocks * Fix upgrade of storage. Co-authored-by: Xiliang Chen <xlchen1291@gmail.com> * trigger CI * put back doc Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
bumped authorship pallet to framev2 :)
This PR needs a polkadot companion pr to add Authorship to certain mocks
construct-runtime!
.The pallet needs to be part of the pallets in construct_runtime to work properly, thus tests might need to be changed.
polkadot companion: paritytech/polkadot#2945