From 57a38769a8c6795a9d992527770fdec097c84ec6 Mon Sep 17 00:00:00 2001 From: Ayush Mishra Date: Fri, 2 Aug 2024 14:11:43 +0530 Subject: [PATCH] Fixing Cluster Migration (#408) ## Description ## Types of Changes Please select the branch type you are merging and fill in the relevant template. - [ ] Hotfix - [ ] Release - [ ] Fix or Feature ## Fix or Feature ### Types of Changes - [ ] Tech Debt (Code improvements) - [ ] 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 - [ ] This change requires a runtime migration. - [ ] Modifies `on_initialize` - [ ] Modifies `on_finalize` ### Checklist for Fix or Feature - [ ] Change has been tested locally. - [ ] Change adds / updates tests if applicable. - [ ] Changelog doc updated. - [ ] `spec_version` has been incremented. - [ ] `network-relayer`'s [events](https://github.com/Cerebellum-Network/network-relayer/blob/dev-cere/shared/substrate/events.go) have been updated according to the blockchain events if applicable. - [ ] All CI checks have been passed successfully ## 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 incremented. - [ ] Transaction version has been updated if required. - [ ] Pull Request to `dev` has been created. - [ ] Pull Request to `staging` has been created. - [ ] `network-relayer`'s [events](https://github.com/Cerebellum-Network/network-relayer/blob/dev-cere/shared/substrate/events.go) have been updated according to the blockchain events if applicable. - [ ] All CI checks have been passed successfully ## 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. - [ ] All CI checks have been passed successfully --- pallets/ddc-clusters/src/lib.rs | 2 +- pallets/ddc-payouts/src/lib.rs | 3 ++- runtime/cere-dev/src/lib.rs | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pallets/ddc-clusters/src/lib.rs b/pallets/ddc-clusters/src/lib.rs index ba9b91aba..0f7b149d1 100644 --- a/pallets/ddc-clusters/src/lib.rs +++ b/pallets/ddc-clusters/src/lib.rs @@ -70,7 +70,7 @@ pub mod pallet { /// The current storage version. const STORAGE_VERSION: frame_support::traits::StorageVersion = - frame_support::traits::StorageVersion::new(2); + frame_support::traits::StorageVersion::new(3); #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] diff --git a/pallets/ddc-payouts/src/lib.rs b/pallets/ddc-payouts/src/lib.rs index df280d392..15365307c 100644 --- a/pallets/ddc-payouts/src/lib.rs +++ b/pallets/ddc-payouts/src/lib.rs @@ -257,6 +257,7 @@ pub mod pallet { NoBucketWithId, NotBucketOwner, IncorrectClusterId, + ClusterProtocolParamsNotSet, } #[pallet::storage] @@ -624,7 +625,7 @@ pub mod pallet { // deduct fees let fees = T::ClusterProtocol::get_fees_params(&cluster_id) - .map_err(|_| Error::::NotExpectedClusterState)?; + .map_err(|_| Error::::ClusterProtocolParamsNotSet)?; let total_customer_charge = (|| -> Option { billing_report diff --git a/runtime/cere-dev/src/lib.rs b/runtime/cere-dev/src/lib.rs index 41251e123..00cbc7b72 100644 --- a/runtime/cere-dev/src/lib.rs +++ b/runtime/cere-dev/src/lib.rs @@ -146,7 +146,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: 54109, + spec_version: 54110, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 19, @@ -1402,7 +1402,7 @@ pub type SignedPayload = generic::SignedPayload; pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Runtime migrations -type Migrations = (); +type Migrations = (pallet_ddc_clusters::migrations::v3::MigrateToV3,); /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive<