Skip to content

Commit c7f7859

Browse files
committed
have an option to set a migration lim
Migration limit could be set either by fellowship or MigController
1 parent ec4f19c commit c7f7859

File tree

2 files changed

+12
-4
lines changed
  • system-parachains/asset-hubs

2 files changed

+12
-4
lines changed

system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,8 +1786,11 @@ impl pallet_state_trie_migration::Config for Runtime {
17861786
type RuntimeHoldReason = RuntimeHoldReason;
17871787
type SignedDepositPerItem = MigrationSignedDepositPerItem;
17881788
type SignedDepositBase = MigrationSignedDepositBase;
1789-
// An origin that can control the whole pallet.
1790-
type ControlOrigin = EnsureSigned<MigController, AccountId>;
1789+
// An origin that can control the whole pallet: Should be a Fellowship member or the controller of the migration.
1790+
type ControlOrigin = EitherOfDiverse<
1791+
EnsureXcm<IsVoiceOfBody<FellowshipLocation, FellowsBodyId>>,
1792+
EnsureSignedBy<MigControllerRoot, AccountId>
1793+
>;
17911794
type SignedFilter = EnsureSignedBy<MigController, AccountId>;
17921795

17931796
// Replace this with weight based on your runtime.
@@ -1799,6 +1802,7 @@ impl pallet_state_trie_migration::Config for Runtime {
17991802
// See bot code https://github.com/paritytech/polkadot-scripts/blob/master/src/services/state_trie_migration.ts
18001803
ord_parameter_types! {
18011804
pub const MigController: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52"));
1805+
pub const MigControllerRoot: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52"));
18021806
}
18031807

18041808
#[cfg(test)]

system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,8 +1765,11 @@ impl pallet_state_trie_migration::Config for Runtime {
17651765
type RuntimeHoldReason = RuntimeHoldReason;
17661766
type SignedDepositPerItem = MigrationSignedDepositPerItem;
17671767
type SignedDepositBase = MigrationSignedDepositBase;
1768-
// An origin that can control the whole pallet.
1769-
type ControlOrigin = EnsureSigned<MigController, AccountId>;
1768+
// An origin that can control the whole pallet: Should be a Fellowship member or the controller of the migration.
1769+
type ControlOrigin = EitherOfDiverse<
1770+
EnsureXcm<IsVoiceOfBody<FellowshipLocation, FellowsBodyId>>,
1771+
EnsureSignedBy<MigControllerRoot, AccountId>
1772+
>;
17701773
type SignedFilter = EnsureSignedBy<MigController, AccountId>;
17711774

17721775
// Replace this with weight based on your runtime.
@@ -1778,6 +1781,7 @@ impl pallet_state_trie_migration::Config for Runtime {
17781781
// See bot code https://github.com/paritytech/polkadot-scripts/blob/master/src/services/state_trie_migration.ts
17791782
ord_parameter_types! {
17801783
pub const MigController: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52"));
1784+
pub const MigControllerRoot: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52"));
17811785
}
17821786

17831787
#[cfg(test)]

0 commit comments

Comments
 (0)