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
@@ -28,6 +28,7 @@ use frame_support::{
assert_err, assert_noop, assert_ok,
traits::{OnFinalize, OnInitialize},
};
use frame_system::pallet_prelude::BlockNumberFor;
use primitives::BlockNumber;
use sp_core::{crypto::CryptoType, Pair};
@@ -2054,9 +2055,10 @@ fn deduplication_and_sorting_works() {
let disputes_orig = disputes.clone();
<Pallet<Test> as DisputesHandler<
<Test as frame_system::Config>::BlockNumber,
>>::deduplicate_and_sort_dispute_data(&mut disputes).unwrap_err();
<Pallet<Test> as DisputesHandler<BlockNumberFor<Test>>>::deduplicate_and_sort_dispute_data(
&mut disputes,
)
.unwrap_err();
// assert ordering of local only disputes, and at the same time, and being free of duplicates
assert_eq!(disputes_orig.len(), disputes.len() + 1);
@@ -2083,10 +2085,11 @@ fn apply_filter_all<T: Config, I: IntoIterator<Item = DisputeStatementSet>>(
let mut acc = Vec::<CheckedDisputeStatementSet>::new();
for dispute_statement in sets {
if let Some(checked) = <Pallet<T> as DisputesHandler<<T>::BlockNumber>>::filter_dispute_data(
dispute_statement,
post_conclusion_acceptance_period,
) {
if let Some(checked) =
<Pallet<T> as DisputesHandler<BlockNumberFor<T>>>::filter_dispute_data(
dispute_statement,
post_conclusion_acceptance_period,
) {
acc.push(checked);
}
}
@@ -2158,9 +2161,11 @@ fn filter_removes_duplicates_within_set() {
};
let post_conclusion_acceptance_period = 10;
let statements = <Pallet<Test> as DisputesHandler<
<Test as frame_system::Config>::BlockNumber,
>>::filter_dispute_data(statements, post_conclusion_acceptance_period);
let statements =
<Pallet<Test> as DisputesHandler<BlockNumberFor<Test>>>::filter_dispute_data(
statements,
post_conclusion_acceptance_period,
);
assert_eq!(
statements,
@@ -2446,7 +2451,7 @@ fn filter_removes_duplicate_statements_sets() {
// `Err(())` indicates presence of duplicates
assert!(<Pallet::<Test> as DisputesHandler<
<Test as frame_system::Config>::BlockNumber,
BlockNumberFor<Test>,
>>::deduplicate_and_sort_dispute_data(&mut sets)
.is_err());