Moves Block to frame_system instead of construct_runtime and removes Header and BlockNumber (#7431)

* Companion for substrate

* Minor update

* Formatting

* Fixes for cumulus

* Fixes tests in polkadot-runtime-parachains

* Minor update

* Removes unused import

* Fixes tests in polkadot-runtime-common

* Minor fix

* Update roadmap/implementers-guide/src/runtime/configuration.md

Co-authored-by: ordian <write@reusable.software>

* ".git/.scripts/commands/fmt/fmt.sh"

* update lockfile for {"substrate"}

---------

Co-authored-by: ordian <write@reusable.software>
Co-authored-by: command-bot <>
This commit is contained in:
gupnik
2023-07-13 18:07:50 +05:30
committed by GitHub
parent bfaec080cc
commit 2802414473
47 changed files with 562 additions and 643 deletions
@@ -116,7 +116,7 @@ pub mod pallet {
+ hrmp::Config
{
/// A randomness beacon.
type Randomness: Randomness<Self::Hash, Self::BlockNumber>;
type Randomness: Randomness<Self::Hash, BlockNumberFor<Self>>;
/// An origin which is allowed to force updates to parachains.
type ForceOrigin: EnsureOrigin<<Self as frame_system::Config>::RuntimeOrigin>;
/// Weight information for extrinsics in this pallet.
@@ -147,7 +147,7 @@ pub mod pallet {
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
fn on_initialize(now: T::BlockNumber) -> Weight {
fn on_initialize(now: BlockNumberFor<T>) -> Weight {
// The other modules are initialized in this order:
// - Configuration
// - Paras
@@ -174,7 +174,7 @@ pub mod pallet {
total_weight
}
fn on_finalize(now: T::BlockNumber) {
fn on_finalize(now: BlockNumberFor<T>) {
// reverse initialization order.
hrmp::Pallet::<T>::initializer_finalize();
dmp::Pallet::<T>::initializer_finalize();