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
+3 -2
View File
@@ -20,6 +20,7 @@
//! dependent on any of the other pallets.
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::BlockNumberFor;
use primitives::{SessionIndex, ValidatorId, ValidatorIndex};
use sp_std::vec::Vec;
@@ -73,7 +74,7 @@ pub mod pallet {
impl<T: Config> Pallet<T> {
/// Called by the initializer to initialize the configuration pallet.
pub(crate) fn initializer_initialize(_now: T::BlockNumber) -> Weight {
pub(crate) fn initializer_initialize(_now: BlockNumberFor<T>) -> Weight {
Weight::zero()
}
@@ -86,7 +87,7 @@ impl<T: Config> Pallet<T> {
pub(crate) fn initializer_on_new_session(
session_index: SessionIndex,
random_seed: [u8; 32],
new_config: &HostConfiguration<T::BlockNumber>,
new_config: &HostConfiguration<BlockNumberFor<T>>,
all_validators: Vec<ValidatorId>,
) -> Vec<ValidatorId> {
CurrentSessionIndex::<T>::set(session_index);