Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Disable filter for signed migration
  • Loading branch information
cheme committed Nov 25, 2022
commit a94fc6a2194590b14a5b75a68c00953179df3711
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>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type SignedFilter = Disable<Runtime>;
type SignedFilter = frame_support::traits::NeverEnsureOrigin<AccountId>;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks (my searching skills are definitely rather bad :( )


// 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