Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Disable filter for signed migration
Browse files Browse the repository at this point in the history
  • Loading branch information
cheme committed Nov 25, 2022
1 parent 0d01e51 commit a94fc6a
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1099,16 +1099,25 @@ impl pallet_state_trie_migration::Config for Runtime {
type SignedDepositPerItem = MigrationSignedDepositPerItem;
type SignedDepositBase = MigrationSignedDepositBase;
type ControlOrigin = EnsureRoot<AccountId>;
// specific account for the migration, can trigger the signed migrations.
type SignedFilter = frame_system::EnsureSignedBy<MigController, AccountId>;
type SignedFilter = Disable<Runtime>;

// Use same weights as substrate ones.
type WeightInfo = pallet_state_trie_migration::weights::SubstrateWeight<Runtime>;
type MaxKeyLen = MigrationMaxKeyLen;
}

frame_support::ord_parameter_types! {
pub const MigController: AccountId = AccountId::from(hex_literal::hex!("8888888888888888888888888888888888888888888888888888888888888888"));
pub struct Disable<T>(sp_std::marker::PhantomData<T>);
impl<T: frame_system::Config> frame_support::traits::EnsureOrigin<T::RuntimeOrigin> for Disable<T> {
type Success = T::AccountId;
fn try_origin(o: T::RuntimeOrigin) -> Result<Self::Success, T::RuntimeOrigin> {
Err(o)
}

#[cfg(feature = "runtime-benchmarks")]
fn try_successful_origin() -> Result<T::RuntimeOrigin, ()> {
// Not correct but this should only cost more.
Ok(T::RuntimeOrigin::root())
}
}

construct_runtime! {
Expand Down

0 comments on commit a94fc6a

Please sign in to comment.