mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 08:41:02 +00:00
Bump Substrate/Polkadot/Cumulus refs (aka Weights v1.5) (#1597)
* update Substrate + Polkadot + Cumulus refs * Origin -> RuntimeOrigin * weights v1.5 * update refs once again + `cargo test -p pallet-bridge-grandpa` works * started work on `cargo test -p pallet-bridge-messages` * cargo test -p pallet-bridge-relayers * cargo test -p pallet-bridge-parachains * cargo test -p millau-runtime * cargo test -p bridge-runtime-common * cargo test -p rialto-runtime * cargo test -p rialto-parachain-runtime * cargo test -p millau-bridge-node * cargo test -p rialto-bridge-node * cargo test -p rialto-parachain-collator * cargo test -p messages-relay * cargo test -p parachains-relay * cargo test -p substrate-relay * cargo test --all * cargo check -p millau-runtime --locked --features runtime-benchmarks * fix remaining test * fmt * try to allow clippy failure temporarily * Revert "try to allow clippy failure temporarily" This reverts commit d1b6593580f07e0dbeecb7ab0aa92cee98888ed3. * use min_by * Revert "use min_by" This reverts commit 33042f49ed37e8dd0505370289e17f03bf1a56ee. * Revert "Revert "use min_by"" This reverts commit 1d2204f0b14dc81e5650bb574dedb5fa78c7097d. * trigger CI * Revert "trigger CI" This reverts commit 259d91b5606743bba9d043c69f07eac6c8700ef5. * new day, new clippy warning * more clippy issues
This commit is contained in:
committed by
Bastian Köcher
parent
9e1847d12a
commit
a3dc2d2748
@@ -135,7 +135,7 @@ pub mod pallet {
|
||||
fn on_initialize(_n: T::BlockNumber) -> frame_support::weights::Weight {
|
||||
<RequestCount<T, I>>::mutate(|count| *count = count.saturating_sub(1));
|
||||
|
||||
(0_u64)
|
||||
Weight::from_ref_time(0)
|
||||
.saturating_add(T::DbWeight::get().reads(1))
|
||||
.saturating_add(T::DbWeight::get().writes(1))
|
||||
}
|
||||
@@ -666,7 +666,7 @@ pub fn initialize_for_benchmarks<T: Config<I>, I: 'static>(header: BridgedHeader
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::mock::{
|
||||
run_test, test_header, Origin, TestHeader, TestNumber, TestRuntime,
|
||||
run_test, test_header, RuntimeOrigin, TestHeader, TestNumber, TestRuntime,
|
||||
MAX_BRIDGED_AUTHORITIES, MAX_HEADER_SIZE,
|
||||
};
|
||||
use bp_runtime::BasicOperatingMode;
|
||||
@@ -676,17 +676,17 @@ mod tests {
|
||||
};
|
||||
use codec::Encode;
|
||||
use frame_support::{
|
||||
assert_err, assert_noop, assert_ok, storage::generator::StorageValue,
|
||||
weights::PostDispatchInfo,
|
||||
assert_err, assert_noop, assert_ok, dispatch::PostDispatchInfo,
|
||||
storage::generator::StorageValue,
|
||||
};
|
||||
use sp_runtime::{Digest, DigestItem, DispatchError};
|
||||
|
||||
fn initialize_substrate_bridge() {
|
||||
assert_ok!(init_with_origin(Origin::root()));
|
||||
assert_ok!(init_with_origin(RuntimeOrigin::root()));
|
||||
}
|
||||
|
||||
fn init_with_origin(
|
||||
origin: Origin,
|
||||
origin: RuntimeOrigin,
|
||||
) -> Result<
|
||||
InitializationData<TestHeader>,
|
||||
sp_runtime::DispatchErrorWithPostInfo<PostDispatchInfo>,
|
||||
@@ -708,7 +708,7 @@ mod tests {
|
||||
let justification = make_default_justification(&header);
|
||||
|
||||
Pallet::<TestRuntime>::submit_finality_proof(
|
||||
Origin::signed(1),
|
||||
RuntimeOrigin::signed(1),
|
||||
Box::new(header),
|
||||
justification,
|
||||
)
|
||||
@@ -763,13 +763,13 @@ mod tests {
|
||||
#[test]
|
||||
fn init_root_or_owner_origin_can_initialize_pallet() {
|
||||
run_test(|| {
|
||||
assert_noop!(init_with_origin(Origin::signed(1)), DispatchError::BadOrigin);
|
||||
assert_ok!(init_with_origin(Origin::root()));
|
||||
assert_noop!(init_with_origin(RuntimeOrigin::signed(1)), DispatchError::BadOrigin);
|
||||
assert_ok!(init_with_origin(RuntimeOrigin::root()));
|
||||
|
||||
// Reset storage so we can initialize the pallet again
|
||||
BestFinalized::<TestRuntime>::kill();
|
||||
PalletOwner::<TestRuntime>::put(2);
|
||||
assert_ok!(init_with_origin(Origin::signed(2)));
|
||||
assert_ok!(init_with_origin(RuntimeOrigin::signed(2)));
|
||||
})
|
||||
}
|
||||
|
||||
@@ -779,7 +779,7 @@ mod tests {
|
||||
assert_eq!(BestFinalized::<TestRuntime>::get(), None,);
|
||||
assert_eq!(Pallet::<TestRuntime>::best_finalized(), None);
|
||||
|
||||
let init_data = init_with_origin(Origin::root()).unwrap();
|
||||
let init_data = init_with_origin(RuntimeOrigin::root()).unwrap();
|
||||
|
||||
assert!(<ImportedHeaders<TestRuntime>>::contains_key(init_data.header.hash()));
|
||||
assert_eq!(BestFinalized::<TestRuntime>::get().unwrap().1, init_data.header.hash());
|
||||
@@ -796,7 +796,7 @@ mod tests {
|
||||
run_test(|| {
|
||||
initialize_substrate_bridge();
|
||||
assert_noop!(
|
||||
init_with_origin(Origin::root()),
|
||||
init_with_origin(RuntimeOrigin::root()),
|
||||
<Error<TestRuntime>>::AlreadyInitialized
|
||||
);
|
||||
})
|
||||
@@ -816,7 +816,7 @@ mod tests {
|
||||
};
|
||||
|
||||
assert_noop!(
|
||||
Pallet::<TestRuntime>::initialize(Origin::root(), init_data),
|
||||
Pallet::<TestRuntime>::initialize(RuntimeOrigin::root(), init_data),
|
||||
Error::<TestRuntime>::TooManyAuthoritiesInSet,
|
||||
);
|
||||
});
|
||||
@@ -835,7 +835,7 @@ mod tests {
|
||||
};
|
||||
|
||||
assert_noop!(
|
||||
Pallet::<TestRuntime>::initialize(Origin::root(), init_data),
|
||||
Pallet::<TestRuntime>::initialize(RuntimeOrigin::root(), init_data),
|
||||
Error::<TestRuntime>::TooLargeHeader,
|
||||
);
|
||||
});
|
||||
@@ -847,7 +847,7 @@ mod tests {
|
||||
initialize_substrate_bridge();
|
||||
|
||||
assert_ok!(Pallet::<TestRuntime>::set_operating_mode(
|
||||
Origin::root(),
|
||||
RuntimeOrigin::root(),
|
||||
BasicOperatingMode::Halted
|
||||
));
|
||||
assert_noop!(
|
||||
@@ -856,7 +856,7 @@ mod tests {
|
||||
);
|
||||
|
||||
assert_ok!(Pallet::<TestRuntime>::set_operating_mode(
|
||||
Origin::root(),
|
||||
RuntimeOrigin::root(),
|
||||
BasicOperatingMode::Normal
|
||||
));
|
||||
assert_ok!(submit_finality_proof(1));
|
||||
@@ -878,7 +878,7 @@ mod tests {
|
||||
submit_finality_proof(1),
|
||||
PostDispatchInfo {
|
||||
actual_weight: None,
|
||||
pays_fee: frame_support::weights::Pays::Yes,
|
||||
pays_fee: frame_support::dispatch::Pays::Yes,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -901,7 +901,7 @@ mod tests {
|
||||
|
||||
assert_err!(
|
||||
Pallet::<TestRuntime>::submit_finality_proof(
|
||||
Origin::signed(1),
|
||||
RuntimeOrigin::signed(1),
|
||||
Box::new(header),
|
||||
justification,
|
||||
),
|
||||
@@ -921,7 +921,7 @@ mod tests {
|
||||
|
||||
assert_err!(
|
||||
Pallet::<TestRuntime>::submit_finality_proof(
|
||||
Origin::signed(1),
|
||||
RuntimeOrigin::signed(1),
|
||||
Box::new(header),
|
||||
justification,
|
||||
),
|
||||
@@ -943,14 +943,14 @@ mod tests {
|
||||
operating_mode: BasicOperatingMode::Normal,
|
||||
};
|
||||
|
||||
assert_ok!(Pallet::<TestRuntime>::initialize(Origin::root(), init_data));
|
||||
assert_ok!(Pallet::<TestRuntime>::initialize(RuntimeOrigin::root(), init_data));
|
||||
|
||||
let header = test_header(1);
|
||||
let justification = make_default_justification(&header);
|
||||
|
||||
assert_err!(
|
||||
Pallet::<TestRuntime>::submit_finality_proof(
|
||||
Origin::signed(1),
|
||||
RuntimeOrigin::signed(1),
|
||||
Box::new(header),
|
||||
justification,
|
||||
),
|
||||
@@ -989,13 +989,13 @@ mod tests {
|
||||
// Let's import our test header
|
||||
assert_ok!(
|
||||
Pallet::<TestRuntime>::submit_finality_proof(
|
||||
Origin::signed(1),
|
||||
RuntimeOrigin::signed(1),
|
||||
Box::new(header.clone()),
|
||||
justification
|
||||
),
|
||||
PostDispatchInfo {
|
||||
actual_weight: None,
|
||||
pays_fee: frame_support::weights::Pays::No,
|
||||
pays_fee: frame_support::dispatch::Pays::No,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1028,7 +1028,7 @@ mod tests {
|
||||
// Should not be allowed to import this header
|
||||
assert_err!(
|
||||
Pallet::<TestRuntime>::submit_finality_proof(
|
||||
Origin::signed(1),
|
||||
RuntimeOrigin::signed(1),
|
||||
Box::new(header),
|
||||
justification
|
||||
),
|
||||
@@ -1053,7 +1053,7 @@ mod tests {
|
||||
// Should not be allowed to import this header
|
||||
assert_err!(
|
||||
Pallet::<TestRuntime>::submit_finality_proof(
|
||||
Origin::signed(1),
|
||||
RuntimeOrigin::signed(1),
|
||||
Box::new(header),
|
||||
justification
|
||||
),
|
||||
@@ -1078,7 +1078,7 @@ mod tests {
|
||||
// Should not be allowed to import this header
|
||||
assert_err!(
|
||||
Pallet::<TestRuntime>::submit_finality_proof(
|
||||
Origin::signed(1),
|
||||
RuntimeOrigin::signed(1),
|
||||
Box::new(header),
|
||||
justification
|
||||
),
|
||||
@@ -1103,7 +1103,7 @@ mod tests {
|
||||
// Should not be allowed to import this header
|
||||
assert_err!(
|
||||
Pallet::<TestRuntime>::submit_finality_proof(
|
||||
Origin::signed(1),
|
||||
RuntimeOrigin::signed(1),
|
||||
Box::new(header),
|
||||
justification
|
||||
),
|
||||
@@ -1168,7 +1168,7 @@ mod tests {
|
||||
invalid_justification.round = 42;
|
||||
|
||||
Pallet::<TestRuntime>::submit_finality_proof(
|
||||
Origin::signed(1),
|
||||
RuntimeOrigin::signed(1),
|
||||
Box::new(header),
|
||||
invalid_justification,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user