From f1c9b99323a7dea5fdae4d11d15509aaf4bf7e29 Mon Sep 17 00:00:00 2001 From: olegnn Date: Mon, 14 Oct 2024 12:44:49 +0200 Subject: [PATCH] Temporary revert "Migration pallet (#190)" This reverts commit e594602c16d26210fcef98b7fec77ededfc8a747. --- Cargo.lock | 26 ----- Cargo.toml | 1 - pallets/agreement/Cargo.toml | 15 ++- pallets/cheqd-migration/Cargo.toml | 91 --------------- pallets/cheqd-migration/src/benchmarks.rs | 51 --------- pallets/cheqd-migration/src/lib.rs | 129 ---------------------- pallets/cheqd-migration/src/mock.rs | 123 --------------------- pallets/cheqd-migration/src/tests.rs | 100 ----------------- pallets/cheqd-migration/src/weights.rs | 58 ---------- pallets/core/Cargo.toml | 9 ++ pallets/token-migration/Cargo.toml | 15 ++- runtime/Cargo.toml | 6 - runtime/src/lib.rs | 16 +-- 13 files changed, 36 insertions(+), 604 deletions(-) delete mode 100644 pallets/cheqd-migration/Cargo.toml delete mode 100644 pallets/cheqd-migration/src/benchmarks.rs delete mode 100644 pallets/cheqd-migration/src/lib.rs delete mode 100644 pallets/cheqd-migration/src/mock.rs delete mode 100644 pallets/cheqd-migration/src/tests.rs delete mode 100644 pallets/cheqd-migration/src/weights.rs diff --git a/Cargo.lock b/Cargo.lock index 61cc316cc..81fc99d57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -419,12 +419,6 @@ version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" -[[package]] -name = "bech32" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" - [[package]] name = "beef" version = "0.5.2" @@ -1505,25 +1499,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "dock-cheqd-migration" -version = "0.1.0" -dependencies = [ - "bech32", - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-balances", - "parity-scale-codec", - "scale-info", - "scale-info-derive 2.3.0", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - [[package]] name = "dock-core" version = "0.5.0" @@ -1813,7 +1788,6 @@ dependencies = [ "beefy-merkle-tree", "beefy-primitives", "dock-agreement", - "dock-cheqd-migration", "dock-core", "dock-poa", "dock-price-feed", diff --git a/Cargo.toml b/Cargo.toml index 3aa51d56f..09473bb43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,6 @@ resolver = "2" members = [ "node", "pallets/agreement", - "pallets/cheqd-migration", "pallets/poa", "pallets/poa/rpc", "pallets/token-migration", diff --git a/pallets/agreement/Cargo.toml b/pallets/agreement/Cargo.toml index 8e082581c..9306ce73f 100644 --- a/pallets/agreement/Cargo.toml +++ b/pallets/agreement/Cargo.toml @@ -26,22 +26,26 @@ version = "1.0.119" [dependencies.frame-support] default-features = false +# version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dependencies.frame-system] default-features = false +# version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dependencies.sp-std] default-features = false +# version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dependencies.frame-benchmarking] optional = true default-features = false +# version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" @@ -53,16 +57,19 @@ branch = "polkadot-v0.9.29" [dev-dependencies.sp-io] default-features = false +# version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dev-dependencies.sp-core] default-features = false +# version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dev-dependencies.sp-runtime] default-features = false +#version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" @@ -74,8 +81,12 @@ std = [ "frame-support/std", "frame-system/std", "sp-std/std", - "frame-benchmarking/std", "sp-runtime/std", ] test = ["std"] -runtime-benchmarks = ["frame-benchmarking"] +runtime-benchmarks = [ + "frame-system-benchmarking", + "frame-benchmarking", + "frame-system/runtime-benchmarks", + "frame-support/runtime-benchmarks", +] diff --git a/pallets/cheqd-migration/Cargo.toml b/pallets/cheqd-migration/Cargo.toml deleted file mode 100644 index 6218a130d..000000000 --- a/pallets/cheqd-migration/Cargo.toml +++ /dev/null @@ -1,91 +0,0 @@ -[package] -name = "dock-cheqd-migration" -version = "0.1.0" -authors = ["Dock.io"] -edition = "2021" -license = "Apache-2.0" - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies.bech32] -version = "0.11.0" -default-features = false -features = ["alloc"] - -[dev-dependencies.pallet-balances] -default-features = false -git = "https://github.com/paritytech/substrate.git" -branch = "polkadot-v0.9.29" - -[dependencies.scale-info-derive] -git = "https://github.com/docknetwork/scale-info.git" -branch = "master" - -[dependencies.scale-info] -version = "2.1.2" -default-features = false -features = ["derive"] - -[dependencies.codec] -default-features = false -features = ["derive"] -package = "parity-scale-codec" -version = "3.1.5" - -[dependencies.serde] -features = ["derive"] -optional = true -version = "1.0.119" - -[dependencies.frame-support] -default-features = false -git = "https://github.com/paritytech/substrate.git" -branch = "polkadot-v0.9.29" - -[dependencies.frame-system] -default-features = false -git = "https://github.com/paritytech/substrate.git" -branch = "polkadot-v0.9.29" - -[dependencies.sp-std] -default-features = false -git = "https://github.com/paritytech/substrate.git" -branch = "polkadot-v0.9.29" - -[dependencies.frame-benchmarking] -optional = true -default-features = false -git = "https://github.com/paritytech/substrate.git" -branch = "polkadot-v0.9.29" - -[dev-dependencies.sp-io] -default-features = false -git = "https://github.com/paritytech/substrate.git" -branch = "polkadot-v0.9.29" - -[dev-dependencies.sp-core] -default-features = false -git = "https://github.com/paritytech/substrate.git" -branch = "polkadot-v0.9.29" - -[dependencies.sp-runtime] -default-features = false -git = "https://github.com/paritytech/substrate.git" -branch = "polkadot-v0.9.29" - -[features] -default = ["std"] -std = [ - "codec/std", - "serde", - "bech32/std", - "frame-support/std", - "frame-system/std", - "pallet-balances/std", - "sp-std/std", - "frame-benchmarking/std", - "sp-runtime/std", -] -test = ["std"] -runtime-benchmarks = ["frame-benchmarking"] diff --git a/pallets/cheqd-migration/src/benchmarks.rs b/pallets/cheqd-migration/src/benchmarks.rs deleted file mode 100644 index a30b7a5fe..000000000 --- a/pallets/cheqd-migration/src/benchmarks.rs +++ /dev/null @@ -1,51 +0,0 @@ -use super::*; -use frame_benchmarking::{benchmarks, whitelisted_caller}; -use frame_support::traits::{Currency, IsType}; -use frame_system::{Pallet as System, RawOrigin}; -use scale_info::prelude::string::ToString; -use sp_runtime::{traits::Zero, DispatchError}; - -fn assert_event(expected_event: impl Into<::Event>) { - let events = System::::events(); - let expected_event = expected_event.into(); - - assert!(events - .iter() - .any(|event| &event.event == expected_event.into_ref())); -} - -benchmarks! { - migrate { - let destination = "cheqd1fktkf9nsj625jkxz7r7gmryna6uy8y2pptang4".to_string(); - let caller: T::AccountId = whitelisted_caller(); - T::Currency::make_free_balance_be(&caller, 100_000_000u32.into()); - let dock_tokens_amount = T::Currency::free_balance(&caller); - - }: _(RawOrigin::Signed(caller.clone()), destination.clone()) - verify { - assert_event::(Event::::Migrated { - dock_account: caller.clone(), - cheqd_account: CheqdAddress::new::(destination).unwrap(), - dock_tokens_amount, - accepted_terms_and_conditions: true - }); - assert!( - T::Currency::free_balance(&caller).is_zero() - ); - } - - migrate_validation_failure { - let destination = "cosmos12zddgw36trnvwm4s3x0etjd86r4lgqdthrzjdk".to_string(); - let caller: T::AccountId = whitelisted_caller(); - let dock_tokens_amount = T::Currency::free_balance(&caller); - - }: { - Pallet::::migrate(RawOrigin::Signed(caller.clone()).into(), destination.clone()).unwrap_err(); - Ok::<_, DispatchError>(()) - } - verify { - assert_eq!( - T::Currency::free_balance(&caller), dock_tokens_amount - ); - } -} diff --git a/pallets/cheqd-migration/src/lib.rs b/pallets/cheqd-migration/src/lib.rs deleted file mode 100644 index 2a46d5e01..000000000 --- a/pallets/cheqd-migration/src/lib.rs +++ /dev/null @@ -1,129 +0,0 @@ -//! A pallet that facilitates the smooth transfer of `DOCK` tokens from the `Dock` Chain to `CHEQD` tokens on the `Cheqd` Chain. - -#![cfg_attr(not(feature = "std"), no_std)] - -use scale_info::prelude::string::String; - -#[cfg(feature = "runtime-benchmarks")] -pub mod benchmarks; -#[cfg(test)] -mod mock; -#[cfg(test)] -mod tests; -mod weights; - -// Re-export pallet items so that they can be accessed from the crate namespace. -pub use pallet::*; - -use weights::{SubstrateWeight, WeightInfo}; - -#[frame_support::pallet] -pub mod pallet { - use super::*; - use frame_support::{ - dispatch::WithPostDispatchInfo, - pallet_prelude::*, - traits::{Currency, ExistenceRequirement::AllowDeath}, - }; - use frame_system::pallet_prelude::*; - use sp_runtime::traits::Zero; - - type BalanceOf = - <::Currency as Currency<::AccountId>>::Balance; - - /// Address of the recipient on the `cheqd` side. - #[derive(Encode, Decode, Clone, Debug, PartialEq, Eq, Ord, PartialOrd)] - #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] - #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] - #[derive(scale_info_derive::TypeInfo)] - #[scale_info(omit_prefix)] - pub struct CheqdAddress(String); - - impl CheqdAddress { - pub fn new(value: String) -> Result> { - let (prefix, addr) = - bech32::decode(&value).map_err(|_| Error::::AddressMustBeValidBech32)?; - ensure!( - prefix.as_str() == "cheqd", - Error::::AddressMustStartWithCheqd - ); - ensure!(addr.len() == 20, Error::::InvalidAddressLength); - - Ok(Self(value)) - } - } - - #[pallet::config] - pub trait Config: frame_system::Config { - /// The overarching event type. - type Event: From> + IsType<::Event>; - /// The currency to be burnt during migration. - type Currency: Currency; - /// Id of the recipient account on the dock side to send burnt funds. - type BurnDestination: Get; - } - - #[pallet::error] - pub enum Error { - /// `cheqd` address must start with `cheqd` prefix. - AddressMustStartWithCheqd, - /// Provided `cheqd` address is invalid because it has an incorrect length. - InvalidAddressLength, - /// `cheqd` address part coming after `cheqd` must be a valid bech-32 sequence. - AddressMustBeValidBech32, - /// Caller account's balance is zero. - BalanceIsZero, - } - - #[pallet::pallet] - pub struct Pallet(_); - - #[pallet::call] - impl Pallet { - /// Burns the free `DOCK` balance of the sender and emits an event containing the supplied recipient `cheqd` address. - /// By submitting this transaction, you agree to the Terms and Conditions. - #[pallet::weight(SubstrateWeight::::migrate())] - pub fn migrate(origin: OriginFor, cheqd_address: String) -> DispatchResultWithPostInfo { - let dock_account = ensure_signed(origin)?; - - let cheqd_account = CheqdAddress::new::(cheqd_address) - .map_err(DispatchError::from) - .map_err(|error| { - error.with_weight(SubstrateWeight::::migrate_validation_failure()) - })?; - - let dock_tokens_amount = T::Currency::free_balance(&dock_account); - ensure!(!dock_tokens_amount.is_zero(), Error::::BalanceIsZero); - - let dest = T::BurnDestination::get(); - T::Currency::transfer(&dock_account, &dest, dock_tokens_amount, AllowDeath)?; - - Self::deposit_event(Event::Migrated { - dock_account, - cheqd_account, - dock_tokens_amount, - accepted_terms_and_conditions: true, - }); - - Ok(Pays::Yes.into()) - } - } - - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] - pub enum Event { - /// The corresponding amount of `DOCK` tokens were burned on the `Dock` Chain side, - /// and `CHEQD` tokens will be issued to the specified address on the `cheqd` Chain side. - /// Terms and conditions were accepted by the sender. - Migrated { - /// The account whose funds were burnt on the `Dock` side. - dock_account: T::AccountId, - /// Recipient address on the `cheqd` side which will receive `CHEQD` tokens. - cheqd_account: CheqdAddress, - /// Amount of the burnt DOCK tokens. - dock_tokens_amount: BalanceOf, - /// Indicates whether terms and conditions were accepted by the sender. - accepted_terms_and_conditions: bool, - }, - } -} diff --git a/pallets/cheqd-migration/src/mock.rs b/pallets/cheqd-migration/src/mock.rs deleted file mode 100644 index 4468555e5..000000000 --- a/pallets/cheqd-migration/src/mock.rs +++ /dev/null @@ -1,123 +0,0 @@ -use super::*; -use crate as dock_cheqd_migration; - -use codec::{Decode, Encode}; -use frame_support::{ - parameter_types, - sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, IdentityLookup}, - Perbill, - }, - weights::{ - constants::{RocksDbWeight, WEIGHT_PER_SECOND}, - Weight, - }, -}; -use pallet_balances::AccountData; -use sp_core::H256; -use sp_runtime::traits::{ConstU32, ConstU64}; - -// Configure a mock runtime to test the pallet. -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; -type Block = frame_system::mocking::MockBlock; -frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Config, Storage, Event}, - Migration: dock_cheqd_migration::{Pallet, Call, Event}, - } -); - -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const MaximumBlockWeight: Weight = WEIGHT_PER_SECOND.saturating_mul(2); - pub const MaximumBlockLength: u32 = 2 * 1024; - pub const AvailableBlockRatio: Perbill = Perbill::one(); - pub const TransactionByteFee: u64 = 1; - // Not accepting any uncles - pub const UncleGenerations: u32 = 0; - pub const MinimumPeriod: u64 = 1000; -} - -#[derive(Encode, Decode, scale_info::TypeInfo, Clone, PartialEq, Debug, Eq)] -pub enum TestEvent { - Migration(dock_cheqd_migration::Event), - Balances(pallet_balances::Event), - System(frame_system::Event), -} - -impl From> for TestEvent { - fn from(event: frame_system::Event) -> Self { - Self::System(event) - } -} - -impl From> for TestEvent { - fn from(event: pallet_balances::Event) -> Self { - Self::Balances(event) - } -} - -impl From> for TestEvent { - fn from(event: dock_cheqd_migration::Event) -> Self { - Self::Migration(event) - } -} - -impl pallet_balances::Config for Test { - type AccountStore = System; - type Balance = u64; - type DustRemoval = (); - type Event = TestEvent; - type ExistentialDeposit = ConstU64<0>; - type MaxLocks = ConstU32<50>; - type MaxReserves = (); - type ReserveIdentifier = (); - type WeightInfo = (); -} - -impl frame_system::Config for Test { - type OnSetCode = (); - type MaxConsumers = sp_runtime::traits::ConstU32<10>; - type BaseCallFilter = frame_support::traits::Everything; - type Origin = Origin; - type Call = Call; - type Index = u64; - type BlockNumber = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; - type Header = Header; - type Event = TestEvent; - type BlockHashCount = BlockHashCount; - type DbWeight = RocksDbWeight; - type BlockWeights = (); - type BlockLength = (); - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); -} - -impl Config for Test { - type Event = TestEvent; - type Currency = Balances; - type BurnDestination = ConstU64<999>; -} - -// Build genesis storage according to the mock runtime. -pub fn new_test_ext() -> sp_io::TestExternalities { - frame_system::GenesisConfig::default() - .build_storage::() - .unwrap() - .into() -} diff --git a/pallets/cheqd-migration/src/tests.rs b/pallets/cheqd-migration/src/tests.rs deleted file mode 100644 index c5c14dadc..000000000 --- a/pallets/cheqd-migration/src/tests.rs +++ /dev/null @@ -1,100 +0,0 @@ -use super::{CheqdAddress, Config, Error, Event, Pallet as Migration, SubstrateWeight, WeightInfo}; -use crate::mock::*; -use frame_support::{assert_noop, assert_ok, dispatch::WithPostDispatchInfo, traits::Get}; -use frame_system::RawOrigin; - -const ALICE: u64 = 1; -const ALICE_BALANCE: u64 = 100_000_000; - -fn assert_event(expected_event: Event) { - let events = System::events(); - let system_event = expected_event.into(); - - assert!(events.iter().any(|event| &event.event == &system_event)); -} - -#[test] -fn migrate_works_for_valid_address() { - new_test_ext().execute_with(|| { - Balances::set_balance(RawOrigin::Root.into(), ALICE, ALICE_BALANCE, 100).unwrap(); - System::set_block_number(System::block_number() + 1); //otherwise event won't be registered. - let cheqd_recipient = "cheqd1fktkf9nsj625jkxz7r7gmryna6uy8y2pptang4".to_string(); - assert_ok!(Migration::::migrate( - Origin::signed(ALICE), - cheqd_recipient.clone() - )); - assert_eq!( - ::Currency::free_balance(&::BurnDestination::get()), - ALICE_BALANCE - ); - assert_eq!(::Currency::free_balance(&ALICE), 0); - assert_eq!(::Currency::reserved_balance(&ALICE), 100); - assert_event(Event::Migrated { - dock_account: ALICE, - cheqd_account: CheqdAddress::new::(cheqd_recipient).unwrap(), - dock_tokens_amount: ALICE_BALANCE, - accepted_terms_and_conditions: true, - }); - }) -} - -#[test] -fn migrate_fails_for_address_without_cheqd_prefix() { - new_test_ext().execute_with(|| { - let invalid_destination = "1umz9zuh47y8qqlhmntq9yvdwrh4w47jf8nuecc".to_string(); - assert_noop!( - Migration::::migrate(Origin::signed(ALICE), invalid_destination), - Error::::AddressMustBeValidBech32.with_weight(SubstrateWeight::< - ::DbWeight, - >::migrate_validation_failure( - )) - ); - let invalid_destination = "cosmos12zddgw36trnvwm4s3x0etjd86r4lgqdthrzjdk".to_string(); - assert_noop!( - Migration::::migrate(Origin::signed(ALICE), invalid_destination), - Error::::AddressMustStartWithCheqd.with_weight(SubstrateWeight::< - ::DbWeight, - >::migrate_validation_failure( - )) - ); - }) -} - -#[test] -fn migrate_fails_for_address_wrong_length() { - new_test_ext().execute_with(|| { - let invalid_destination = "cheqd123".to_string(); - assert_noop!( - Migration::::migrate(Origin::signed(ALICE), invalid_destination), - Error::::AddressMustBeValidBech32.with_weight(SubstrateWeight::< - ::DbWeight, - >::migrate_validation_failure( - )) - ); - }) -} - -#[test] -fn migrate_fails_for_address_invalid_base32() { - new_test_ext().execute_with(|| { - let invalid_destination = "cheqd1Amz9zuh47y8qqlhmntq9yvdwrh4w47jf8nuecc".to_string(); - assert_noop!( - Migration::::migrate(Origin::signed(ALICE), invalid_destination), - Error::::AddressMustBeValidBech32.with_weight(SubstrateWeight::< - ::DbWeight, - >::migrate_validation_failure( - )) - ); - }) -} - -#[test] -fn migrate_does_not_execute_when_balances_zero() { - new_test_ext().execute_with(|| { - let destination = "cheqd1fktkf9nsj625jkxz7r7gmryna6uy8y2pptang4".to_string(); - assert_noop!( - Migration::::migrate(Origin::signed(99), destination), - Error::::BalanceIsZero - ); - }) -} diff --git a/pallets/cheqd-migration/src/weights.rs b/pallets/cheqd-migration/src/weights.rs deleted file mode 100644 index 49a5c2d7b..000000000 --- a/pallets/cheqd-migration/src/weights.rs +++ /dev/null @@ -1,58 +0,0 @@ -//! Autogenerated weights for pallet_migration -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-09-12, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 - -// Executed Command: -// ./target/release/dock-node -// benchmark -// pallet -// --wasm-execution=compiled -// --pallet=pallet_migration -// --extra -// --repeat=20 -// --extrinsic=* -// --steps=50 -// --template=node/module-weight-template-without-system.hbs -// --output=./pallets/cheqd-migration/src/weights.rs - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{ - traits::Get, - weights::{constants::RocksDbWeight, RuntimeDbWeight, Weight}, -}; -use sp_std::marker::PhantomData; - -/// Weight functions needed for pallet_migration. -pub trait WeightInfo { - fn migrate() -> Weight; - fn migrate_validation_failure() -> Weight; -} - -/// Weights for pallet_migration using the Substrate node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl> WeightInfo for SubstrateWeight { - fn migrate() -> Weight { - Weight::from_ref_time(20_000_000) - .saturating_add(W::get().reads(1)) - .saturating_add(W::get().writes(1)) - } - fn migrate_validation_failure() -> Weight { - Weight::from_ref_time(3_000_000) - } -} - -// For backwards compatibility and tests -impl WeightInfo for () { - fn migrate() -> Weight { - Weight::from_ref_time(20_000_000) - .saturating_add(RocksDbWeight::get().reads(1)) - .saturating_add(RocksDbWeight::get().writes(1)) - } - fn migrate_validation_failure() -> Weight { - Weight::from_ref_time(3_000_000) - } -} diff --git a/pallets/core/Cargo.toml b/pallets/core/Cargo.toml index aa0188136..0d50d8842 100644 --- a/pallets/core/Cargo.toml +++ b/pallets/core/Cargo.toml @@ -55,37 +55,44 @@ version = "3.1.5" [dependencies.sp-core] default-features = false +#version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" features = ["full_crypto"] [dependencies.sp-std] default-features = false +#version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dependencies.sp-runtime] default-features = false +#version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dependencies.sp-io] default-features = false +#version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dependencies.frame-system] default-features = false +#version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dependencies.frame-support] default-features = false +#version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dependencies.sp-api] default-features = false +#version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" @@ -95,6 +102,7 @@ optional = true [dependencies.sp-application-crypto] default-features = false +#version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" features = ["full_crypto"] @@ -102,6 +110,7 @@ features = ["full_crypto"] [dependencies.frame-benchmarking] optional = true default-features = false +#version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" diff --git a/pallets/token-migration/Cargo.toml b/pallets/token-migration/Cargo.toml index b8601af8e..8bbc0e815 100644 --- a/pallets/token-migration/Cargo.toml +++ b/pallets/token-migration/Cargo.toml @@ -26,22 +26,26 @@ version = "1.0.119" [dependencies.frame-support] default-features = false +# version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dependencies.frame-system] default-features = false +# version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dependencies.sp-std] default-features = false +# version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dependencies.frame-benchmarking] optional = true default-features = false +# version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" @@ -53,17 +57,20 @@ branch = "polkadot-v0.9.29" [dev-dependencies.sp-io] default-features = false +# version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dev-dependencies.sp-core] default-features = false +# version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" [dev-dependencies.balances] default-features = false package = "pallet-balances" +# version = "3.0.0" git = "https://github.com/paritytech/substrate.git" branch = "polkadot-v0.9.29" @@ -74,12 +81,12 @@ std = [ "serde", "frame-support/std", "frame-system/std", - "sp-std/std", + "sp-std/std" ] test = ["std", "balances/std"] runtime-benchmarks = [ "frame-system-benchmarking", - "frame-benchmarking", + "frame-benchmarking", "frame-system/runtime-benchmarks", - "frame-support/runtime-benchmarks", -] + "frame-support/runtime-benchmarks", +] \ No newline at end of file diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 9aff7af68..8811c4a16 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -456,10 +456,6 @@ path = "../pallets/token-migration" default-features = false path = "../pallets/core" -[dependencies.dock-cheqd-migration] -default-features = false -path = "../pallets/cheqd-migration" - [dependencies.dock-agreement] default-features = false path = "../pallets/agreement" @@ -624,7 +620,6 @@ std = [ "dock-poa/std", "dock-token-migration/std", "dock-core/std", - "dock-cheqd-migration/std", "dock-agreement/std", "dock-price-feed/std", "pallet-base-fee/std", @@ -652,7 +647,6 @@ runtime-benchmarks = [ "frame-system-benchmarking", "dock-token-migration/runtime-benchmarks", "dock-core/runtime-benchmarks", - "dock-cheqd-migration/runtime-benchmarks", "dock-agreement/runtime-benchmarks", "pallet-staking/runtime-benchmarks", ] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index b2795d73b..46336e41a 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -200,7 +200,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("dock-pos-dev-runtime"), impl_name: create_runtime_str!("Dock"), authoring_version: 1, - spec_version: 64, + spec_version: 63, impl_version: 2, transaction_version: 2, apis: RUNTIME_API_VERSIONS, @@ -1743,11 +1743,10 @@ impl pallet_evm::Config for Runtime { parameter_types! { pub const MaxSymbolBytesLen: u32 = 10; - pub BurnDestination: AccountId = AccountId::from_slice(&[99u8; 32]).unwrap(); } impl dock_price_feed::Config for Runtime { - type MaxSymbolBytesLen = ConstU32<10>; + type MaxSymbolBytesLen = MaxSymbolBytesLen; type Event = Event; } @@ -1755,12 +1754,6 @@ impl dock_agreement::Config for Runtime { type Event = Event; } -impl dock_cheqd_migration::Config for Runtime { - type Event = Event; - type Currency = Balances; - type BurnDestination = BurnDestination; -} - parameter_types! { pub PrecompilesValue: FrontierPrecompiles = FrontierPrecompiles::<_>::new(); } @@ -1816,8 +1809,7 @@ construct_runtime!( BaseFee: pallet_base_fee::{Pallet, Call, Storage, Config, Event} = 41, StatusListCredential: status_list_credential::{Pallet, Call, Storage, Event} = 42, TrustRegistry: trust_registry::{Pallet, Call, Storage, Event} = 43, - Agreement: dock_agreement::{Pallet, Call, Event} = 44, - CheqdMigration: dock_cheqd_migration::{Pallet, Call, Event} = 45 + Agreement: dock_agreement::{Pallet, Call, Event} = 44 } ); @@ -2562,7 +2554,6 @@ impl_runtime_apis! { list_benchmark!(list, extra, pallet_election_provider_multi_phase, ElectionProviderMultiPhase); list_benchmark!(list, extra, pallet_grandpa, GrandpaFinality); list_benchmark!(list, extra, pallet_im_online, ImOnline); - list_benchmark!(list, extra, pallet_migration, CheqdMigration); macro_rules! storage_info { ($($pallet: ty),+) => { @@ -2677,7 +2668,6 @@ impl_runtime_apis! { add_benchmark!(params, batches, pallet_election_provider_multi_phase, ElectionProviderMultiPhase); add_benchmark!(params, batches, pallet_grandpa, GrandpaFinality); add_benchmark!(params, batches, pallet_im_online, ImOnline); - add_benchmark!(params, batches, pallet_migration, CheqdMigration); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches)