From a94fc6a2194590b14a5b75a68c00953179df3711 Mon Sep 17 00:00:00 2001 From: cheme Date: Fri, 25 Nov 2022 10:16:38 +0100 Subject: [PATCH] Disable filter for signed migration --- runtime/westend/src/lib.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 279b74107686..049ce3ad18e0 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1099,16 +1099,25 @@ impl pallet_state_trie_migration::Config for Runtime { type SignedDepositPerItem = MigrationSignedDepositPerItem; type SignedDepositBase = MigrationSignedDepositBase; type ControlOrigin = EnsureRoot; - // specific account for the migration, can trigger the signed migrations. - type SignedFilter = frame_system::EnsureSignedBy; + type SignedFilter = Disable; // Use same weights as substrate ones. type WeightInfo = pallet_state_trie_migration::weights::SubstrateWeight; type MaxKeyLen = MigrationMaxKeyLen; } -frame_support::ord_parameter_types! { - pub const MigController: AccountId = AccountId::from(hex_literal::hex!("8888888888888888888888888888888888888888888888888888888888888888")); +pub struct Disable(sp_std::marker::PhantomData); +impl frame_support::traits::EnsureOrigin for Disable { + type Success = T::AccountId; + fn try_origin(o: T::RuntimeOrigin) -> Result { + Err(o) + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + // Not correct but this should only cost more. + Ok(T::RuntimeOrigin::root()) + } } construct_runtime! {