From 99feab3a2d9f25290f8e6ce5bd24cafe910c4eb8 Mon Sep 17 00:00:00 2001 From: Yahor Tsaryk Date: Wed, 8 May 2024 11:11:13 +0200 Subject: [PATCH] Fix of the substrate 1.1.0 and OpenGov to pass the try-runtime check (#330) ## Description ## Types of Changes Please select the branch type you are merging and fill in the relevant template. - [ ] Hotfix - [ ] Release - [x] Fix or Feature ## Fix or Feature ### Types of Changes - [ ] Tech Debt (Code improvements) - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Dependency upgrade (A change in substrate or any 3rd party crate version) ### Migrations and Hooks - [x] This change requires a runtime migration. - [ ] Modifies `on_initialize` - [ ] Modifies `on_finalize` ### Checklist for Fix or Feature - [x] Change has been tested locally. - [ ] Change adds / updates tests if applicable. - [ ] Changelog doc updated. ## Checklist for Hotfix - [ ] Change has been deployed to Testnet. - [ ] Change has been tested in Testnet. - [ ] Changelog has been updated. - [ ] Crate version has been updated. - [ ] Spec version has been updated. - [ ] Transaction version has been updated if required. - [ ] Pull Request to `dev` has been created. - [ ] Pull Request to `staging` has been created. ## Checklist for Release - [ ] Change has been deployed to Devnet. - [ ] Change has been tested in Devnet. - [ ] Change has been deployed to Qanet. - [ ] Change has been tested in Qanet. - [ ] Change has been deployed to Testnet. - [ ] Change has been tested in Testnet. - [ ] Changelog has been updated. - [ ] Crate version has been updated. - [ ] Spec version has been updated. - [ ] Transaction version has been updated if required. --- runtime/cere-dev/src/lib.rs | 6 ++++-- runtime/cere/src/lib.rs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/runtime/cere-dev/src/lib.rs b/runtime/cere-dev/src/lib.rs index 54e524a65..ac21adf01 100644 --- a/runtime/cere-dev/src/lib.rs +++ b/runtime/cere-dev/src/lib.rs @@ -140,7 +140,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 53000, + spec_version: 53001, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 16, @@ -430,6 +430,7 @@ parameter_types! { // This number may need to be adjusted in the future if this assumption no longer holds true. pub const MaxLocks: u32 = 50; pub const MaxReserves: u32 = 50; + pub const MaxHolds: u32 = 50; } impl pallet_balances::Config for Runtime { @@ -445,7 +446,7 @@ impl pallet_balances::Config for Runtime { type FreezeIdentifier = (); type MaxFreezes = (); type RuntimeHoldReason = RuntimeHoldReason; - type MaxHolds = ConstU32<0>; + type MaxHolds = MaxHolds; } parameter_types! { @@ -1321,6 +1322,7 @@ pub mod migrations { /// Unreleased migrations. Add new ones here: pub type Unreleased = ( pallet_contracts::migration::Migration, + pallet_referenda::migration::v1::MigrateV0ToV1, // Gov v1 storage migrations // https://github.com/paritytech/polkadot/issues/6749 pallet_elections_phragmen::migrations::unlock_and_unreserve_all_funds::UnlockAndUnreserveAllFunds, diff --git a/runtime/cere/src/lib.rs b/runtime/cere/src/lib.rs index 1053f5b6a..5535f6dd7 100644 --- a/runtime/cere/src/lib.rs +++ b/runtime/cere/src/lib.rs @@ -134,7 +134,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 53000, + spec_version: 53001, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 16, @@ -424,6 +424,7 @@ parameter_types! { // This number may need to be adjusted in the future if this assumption no longer holds true. pub const MaxLocks: u32 = 50; pub const MaxReserves: u32 = 50; + pub const MaxHolds: u32 = 50; } impl pallet_balances::Config for Runtime { @@ -439,7 +440,7 @@ impl pallet_balances::Config for Runtime { type FreezeIdentifier = (); type MaxFreezes = (); type RuntimeHoldReason = RuntimeHoldReason; - type MaxHolds = ConstU32<0>; + type MaxHolds = MaxHolds; } parameter_types! { @@ -1323,6 +1324,7 @@ pub mod migrations { /// Unreleased migrations. Add new ones here: pub type Unreleased = ( pallet_contracts::migration::Migration, + pallet_referenda::migration::v1::MigrateV0ToV1, // Gov v1 storage migrations // https://github.com/paritytech/polkadot/issues/6749 pallet_elections_phragmen::migrations::unlock_and_unreserve_all_funds::UnlockAndUnreserveAllFunds,