Upgrade authorship pallet to Frame-v2 (#8663)

* 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>
This commit is contained in:
ferrell-code
2021-05-02 22:43:56 -04:00
committed by GitHub
parent 8c65e5df36
commit e0f8546481
8 changed files with 104 additions and 84 deletions
+1 -1
View File
@@ -2709,7 +2709,7 @@ where
}
fn note_uncle(author: T::AccountId, _age: T::BlockNumber) {
Self::reward_by_ids(vec![
(<pallet_authorship::Module<T>>::author(), 2),
(<pallet_authorship::Pallet<T>>::author(), 2),
(author, 1)
])
}
+1
View File
@@ -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},
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
Staking: staking::{Pallet, Call, Config<T>, Storage, Event<T>},
+1 -1
View File
@@ -2007,7 +2007,7 @@ fn reward_from_authorship_event_handler_works() {
ExtBuilder::default().build_and_execute(|| {
use pallet_authorship::EventHandler;
assert_eq!(<pallet_authorship::Module<Test>>::author(), 11);
assert_eq!(<pallet_authorship::Pallet<Test>>::author(), 11);
<Module<Test>>::note_author(11);
<Module<Test>>::note_uncle(21, 1);