Companion: Remove uncles related code (#6615)

* Companion: Remove `uncles` related code

https://github.com/paritytech/substrate/pull/13216

* Fix compilation

* update lockfile for {"substrate"}

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
Bastian Köcher
2023-01-29 22:37:49 +01:00
committed by GitHub
parent 70852e9400
commit 7cb0b94fb9
7 changed files with 189 additions and 238 deletions
+183 -195
View File
File diff suppressed because it is too large Load Diff
+1 -3
View File
@@ -124,7 +124,7 @@ mod tests {
UncheckedExtrinsic = UncheckedExtrinsic, UncheckedExtrinsic = UncheckedExtrinsic,
{ {
System: frame_system::{Pallet, Call, Config, Storage, Event<T>}, System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Authorship: pallet_authorship::{Pallet, Call, Storage, Inherent}, Authorship: pallet_authorship::{Pallet, Storage},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>}, Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>}, Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>},
} }
@@ -219,8 +219,6 @@ mod tests {
} }
impl pallet_authorship::Config for Test { impl pallet_authorship::Config for Test {
type FindAuthor = OneAuthor; type FindAuthor = OneAuthor;
type UncleGenerations = ();
type FilterUncle = ();
type EventHandler = (); type EventHandler = ();
} }
+1 -8
View File
@@ -340,14 +340,8 @@ impl pallet_timestamp::Config for Runtime {
type WeightInfo = weights::pallet_timestamp::WeightInfo<Runtime>; type WeightInfo = weights::pallet_timestamp::WeightInfo<Runtime>;
} }
parameter_types! {
pub const UncleGenerations: u32 = 0;
}
impl pallet_authorship::Config for Runtime { impl pallet_authorship::Config for Runtime {
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>; type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
type UncleGenerations = UncleGenerations;
type FilterUncle = ();
type EventHandler = (Staking, ImOnline); type EventHandler = (Staking, ImOnline);
} }
@@ -994,7 +988,6 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Indices(pallet_indices::Call::freeze {..}) | RuntimeCall::Indices(pallet_indices::Call::freeze {..}) |
// Specifically omitting Indices `transfer`, `force_transfer` // Specifically omitting Indices `transfer`, `force_transfer`
// Specifically omitting the entire Balances pallet // Specifically omitting the entire Balances pallet
RuntimeCall::Authorship(..) |
RuntimeCall::Staking(..) | RuntimeCall::Staking(..) |
RuntimeCall::Session(..) | RuntimeCall::Session(..) |
RuntimeCall::Grandpa(..) | RuntimeCall::Grandpa(..) |
@@ -1345,7 +1338,7 @@ construct_runtime! {
// Consensus support. // Consensus support.
// Authorship must be before session in order to note author in the correct session and era // Authorship must be before session in order to note author in the correct session and era
// for im-online and staking. // for im-online and staking.
Authorship: pallet_authorship::{Pallet, Call, Storage} = 5, Authorship: pallet_authorship::{Pallet, Storage} = 5,
Staking: pallet_staking::{Pallet, Call, Storage, Config<T>, Event<T>} = 6, Staking: pallet_staking::{Pallet, Call, Storage, Config<T>, Event<T>} = 6,
Offences: pallet_offences::{Pallet, Storage, Event} = 7, Offences: pallet_offences::{Pallet, Storage, Event} = 7,
Historical: session_historical::{Pallet} = 34, Historical: session_historical::{Pallet} = 34,
+1 -9
View File
@@ -333,15 +333,8 @@ impl pallet_timestamp::Config for Runtime {
type WeightInfo = weights::pallet_timestamp::WeightInfo<Runtime>; type WeightInfo = weights::pallet_timestamp::WeightInfo<Runtime>;
} }
parameter_types! {
pub const UncleGenerations: u32 = 0;
}
// TODO: substrate#2986 implement this properly
impl pallet_authorship::Config for Runtime { impl pallet_authorship::Config for Runtime {
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>; type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
type UncleGenerations = UncleGenerations;
type FilterUncle = ();
type EventHandler = (Staking, ImOnline); type EventHandler = (Staking, ImOnline);
} }
@@ -1173,7 +1166,6 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Indices(pallet_indices::Call::freeze{..}) | RuntimeCall::Indices(pallet_indices::Call::freeze{..}) |
// Specifically omitting Indices `transfer`, `force_transfer` // Specifically omitting Indices `transfer`, `force_transfer`
// Specifically omitting the entire Balances pallet // Specifically omitting the entire Balances pallet
RuntimeCall::Authorship(..) |
RuntimeCall::Staking(..) | RuntimeCall::Staking(..) |
RuntimeCall::Session(..) | RuntimeCall::Session(..) |
RuntimeCall::Grandpa(..) | RuntimeCall::Grandpa(..) |
@@ -1492,7 +1484,7 @@ construct_runtime! {
// Consensus support. // Consensus support.
// Authorship must be before session in order to note author in the correct session and era // Authorship must be before session in order to note author in the correct session and era
// for im-online and staking. // for im-online and staking.
Authorship: pallet_authorship::{Pallet, Call, Storage} = 6, Authorship: pallet_authorship::{Pallet, Storage} = 6,
Staking: pallet_staking::{Pallet, Call, Storage, Config<T>, Event<T>} = 7, Staking: pallet_staking::{Pallet, Call, Storage, Config<T>, Event<T>} = 7,
Offences: pallet_offences::{Pallet, Storage, Event} = 8, Offences: pallet_offences::{Pallet, Storage, Event} = 8,
Historical: session_historical::{Pallet} = 33, Historical: session_historical::{Pallet} = 33,
+1 -8
View File
@@ -324,14 +324,8 @@ impl pallet_timestamp::Config for Runtime {
type WeightInfo = weights::pallet_timestamp::WeightInfo<Runtime>; type WeightInfo = weights::pallet_timestamp::WeightInfo<Runtime>;
} }
parameter_types! {
pub const UncleGenerations: u32 = 0;
}
impl pallet_authorship::Config for Runtime { impl pallet_authorship::Config for Runtime {
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>; type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
type UncleGenerations = UncleGenerations;
type FilterUncle = ();
type EventHandler = ImOnline; type EventHandler = ImOnline;
} }
@@ -925,7 +919,6 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Indices(pallet_indices::Call::freeze {..}) | RuntimeCall::Indices(pallet_indices::Call::freeze {..}) |
// Specifically omitting Indices `transfer`, `force_transfer` // Specifically omitting Indices `transfer`, `force_transfer`
// Specifically omitting the entire Balances pallet // Specifically omitting the entire Balances pallet
RuntimeCall::Authorship(..) |
RuntimeCall::Session(..) | RuntimeCall::Session(..) |
RuntimeCall::Grandpa(..) | RuntimeCall::Grandpa(..) |
RuntimeCall::ImOnline(..) | RuntimeCall::ImOnline(..) |
@@ -1349,7 +1342,7 @@ construct_runtime! {
// Consensus support. // Consensus support.
// Authorship must be before session in order to note author in the correct session and era // Authorship must be before session in order to note author in the correct session and era
// for im-online. // for im-online.
Authorship: pallet_authorship::{Pallet, Call, Storage} = 5, Authorship: pallet_authorship::{Pallet, Storage} = 5,
Offences: pallet_offences::{Pallet, Storage, Event} = 7, Offences: pallet_offences::{Pallet, Storage, Event} = 7,
Historical: session_historical::{Pallet} = 34, Historical: session_historical::{Pallet} = 34,
// MMR leaf construction must be before session in order to have leaf contents // MMR leaf construction must be before session in order to have leaf contents
+1 -7
View File
@@ -254,14 +254,8 @@ impl pallet_timestamp::Config for Runtime {
type WeightInfo = (); type WeightInfo = ();
} }
parameter_types! {
pub storage UncleGenerations: u32 = 0;
}
impl pallet_authorship::Config for Runtime { impl pallet_authorship::Config for Runtime {
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>; type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
type UncleGenerations = UncleGenerations;
type FilterUncle = ();
type EventHandler = Staking; type EventHandler = Staking;
} }
@@ -659,7 +653,7 @@ construct_runtime! {
TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>}, TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>},
// Consensus support. // Consensus support.
Authorship: pallet_authorship::{Pallet, Call, Storage}, Authorship: pallet_authorship::{Pallet, Storage},
Staking: pallet_staking::{Pallet, Call, Storage, Config<T>, Event<T>}, Staking: pallet_staking::{Pallet, Call, Storage, Config<T>, Event<T>},
Offences: pallet_offences::{Pallet, Storage, Event}, Offences: pallet_offences::{Pallet, Storage, Event},
Historical: session_historical::{Pallet}, Historical: session_historical::{Pallet},
+1 -8
View File
@@ -294,14 +294,8 @@ impl pallet_timestamp::Config for Runtime {
type WeightInfo = weights::pallet_timestamp::WeightInfo<Runtime>; type WeightInfo = weights::pallet_timestamp::WeightInfo<Runtime>;
} }
parameter_types! {
pub const UncleGenerations: u32 = 0;
}
impl pallet_authorship::Config for Runtime { impl pallet_authorship::Config for Runtime {
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>; type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
type UncleGenerations = UncleGenerations;
type FilterUncle = ();
type EventHandler = (Staking, ImOnline); type EventHandler = (Staking, ImOnline);
} }
@@ -800,7 +794,6 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Indices(pallet_indices::Call::freeze{..}) | RuntimeCall::Indices(pallet_indices::Call::freeze{..}) |
// Specifically omitting Indices `transfer`, `force_transfer` // Specifically omitting Indices `transfer`, `force_transfer`
// Specifically omitting the entire Balances pallet // Specifically omitting the entire Balances pallet
RuntimeCall::Authorship(..) |
RuntimeCall::Staking(..) | RuntimeCall::Staking(..) |
RuntimeCall::Session(..) | RuntimeCall::Session(..) |
RuntimeCall::Grandpa(..) | RuntimeCall::Grandpa(..) |
@@ -1128,7 +1121,7 @@ construct_runtime! {
// Consensus support. // Consensus support.
// Authorship must be before session in order to note author in the correct session and era // Authorship must be before session in order to note author in the correct session and era
// for im-online and staking. // for im-online and staking.
Authorship: pallet_authorship::{Pallet, Call, Storage} = 5, Authorship: pallet_authorship::{Pallet, Storage} = 5,
Staking: pallet_staking::{Pallet, Call, Storage, Config<T>, Event<T>} = 6, Staking: pallet_staking::{Pallet, Call, Storage, Config<T>, Event<T>} = 6,
Offences: pallet_offences::{Pallet, Storage, Event} = 7, Offences: pallet_offences::{Pallet, Storage, Event} = 7,
Historical: session_historical::{Pallet} = 27, Historical: session_historical::{Pallet} = 27,