Skip to content

Commit

Permalink
update config
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci committed Aug 9, 2024
1 parent 637bed5 commit 78fc4ab
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
12 changes: 8 additions & 4 deletions runtime/astar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1190,18 +1190,22 @@ impl frame_support::traits::SortedMembers<AccountId> for OracleMembershipWrapper
}

parameter_types! {
pub MigrationsMaxServiceWeight: Weight = RuntimeBlockWeights::get().max_block.saturating_div(2);
pub MbmServiceWeight: Weight = Perbill::from_percent(80) * RuntimeBlockWeights::get().max_block;
}

impl pallet_migrations::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
#[cfg(not(feature = "runtime-benchmarks"))]
type Migrations = ();
type CursorMaxLen = ConstU32<{ 1 << 16 }>;
// Benchmarks need mocked migrations to guarantee that they succeed.
#[cfg(feature = "runtime-benchmarks")]
type Migrations = pallet_migrations::mock_helpers::MockedMigrations;
type CursorMaxLen = ConstU32<65_536>;
type IdentifierMaxLen = ConstU32<256>;
type MigrationStatusHandler = ();
type FailedMigrationHandler = frame_support::migrations::FreezeChainOnFailedMigration;
type MaxServiceWeight = MigrationsMaxServiceWeight;
type WeightInfo = ();
type MaxServiceWeight = MbmServiceWeight;
type WeightInfo = pallet_migrations::weights::SubstrateWeight<Runtime>;
}

construct_runtime!(
Expand Down
12 changes: 8 additions & 4 deletions runtime/shibuya/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1515,18 +1515,22 @@ impl pallet_collective_proxy::Config for Runtime {
}

parameter_types! {
pub MigrationsMaxServiceWeight: Weight = RuntimeBlockWeights::get().max_block.saturating_div(2);
pub MbmServiceWeight: Weight = Perbill::from_percent(80) * RuntimeBlockWeights::get().max_block;
}

impl pallet_migrations::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
#[cfg(not(feature = "runtime-benchmarks"))]
type Migrations = ();
type CursorMaxLen = ConstU32<{ 1 << 16 }>;
// Benchmarks need mocked migrations to guarantee that they succeed.
#[cfg(feature = "runtime-benchmarks")]
type Migrations = pallet_migrations::mock_helpers::MockedMigrations;
type CursorMaxLen = ConstU32<65_536>;
type IdentifierMaxLen = ConstU32<256>;
type MigrationStatusHandler = ();
type FailedMigrationHandler = frame_support::migrations::FreezeChainOnFailedMigration;
type MaxServiceWeight = MigrationsMaxServiceWeight;
type WeightInfo = ();
type MaxServiceWeight = MbmServiceWeight;
type WeightInfo = pallet_migrations::weights::SubstrateWeight<Runtime>;
}

construct_runtime!(
Expand Down
12 changes: 8 additions & 4 deletions runtime/shiden/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1189,18 +1189,22 @@ impl frame_support::traits::SortedMembers<AccountId> for OracleMembershipWrapper
}

parameter_types! {
pub MigrationsMaxServiceWeight: Weight = RuntimeBlockWeights::get().max_block.saturating_div(2);
pub MbmServiceWeight: Weight = Perbill::from_percent(80) * RuntimeBlockWeights::get().max_block;
}

impl pallet_migrations::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
#[cfg(not(feature = "runtime-benchmarks"))]
type Migrations = ();
type CursorMaxLen = ConstU32<{ 1 << 16 }>;
// Benchmarks need mocked migrations to guarantee that they succeed.
#[cfg(feature = "runtime-benchmarks")]
type Migrations = pallet_migrations::mock_helpers::MockedMigrations;
type CursorMaxLen = ConstU32<65_536>;
type IdentifierMaxLen = ConstU32<256>;
type MigrationStatusHandler = ();
type FailedMigrationHandler = frame_support::migrations::FreezeChainOnFailedMigration;
type MaxServiceWeight = MigrationsMaxServiceWeight;
type WeightInfo = ();
type MaxServiceWeight = MbmServiceWeight;
type WeightInfo = pallet_migrations::weights::SubstrateWeight<Runtime>;
}

construct_runtime!(
Expand Down

0 comments on commit 78fc4ab

Please sign in to comment.