From 83d1ad23fee778c5007c4923dd8efa95c7953367 Mon Sep 17 00:00:00 2001 From: Kailai Wang Date: Fri, 13 Dec 2024 18:41:44 +0000 Subject: [PATCH] move to collab-ai --- parachain/Cargo.toml | 2 +- .../{ => collab-ai}/halving-mint/Cargo.toml | 3 + .../{ => collab-ai}/halving-mint/src/lib.rs | 0 .../{ => collab-ai}/halving-mint/src/mock.rs | 69 +++++-------------- .../{ => collab-ai}/halving-mint/src/tests.rs | 0 .../halving-mint/src/traits.rs | 0 6 files changed, 21 insertions(+), 53 deletions(-) rename parachain/pallets/{ => collab-ai}/halving-mint/Cargo.toml (98%) rename parachain/pallets/{ => collab-ai}/halving-mint/src/lib.rs (100%) rename parachain/pallets/{ => collab-ai}/halving-mint/src/mock.rs (76%) rename parachain/pallets/{ => collab-ai}/halving-mint/src/tests.rs (100%) rename parachain/pallets/{ => collab-ai}/halving-mint/src/traits.rs (100%) diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index 2bf59395b1..9a6b259916 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -11,6 +11,7 @@ members = [ 'pallets/collab-ai/common', 'pallets/collab-ai/curator', 'pallets/collab-ai/guardian', + 'pallets/collab-ai/halving-mint', 'pallets/collab-ai/pool-proposal', 'pallets/collab-ai/investing-pool', 'pallets/extrinsic-filter', @@ -23,7 +24,6 @@ members = [ 'pallets/teebag', 'pallets/vc-management', 'pallets/xcm-asset-manager', - 'pallets/halving-mint', 'pallets/omni-account', 'pallets/omni-account/runtime-api', 'precompiles/assets-erc20', diff --git a/parachain/pallets/halving-mint/Cargo.toml b/parachain/pallets/collab-ai/halving-mint/Cargo.toml similarity index 98% rename from parachain/pallets/halving-mint/Cargo.toml rename to parachain/pallets/collab-ai/halving-mint/Cargo.toml index cc2dfeb55f..b6dc116c12 100644 --- a/parachain/pallets/halving-mint/Cargo.toml +++ b/parachain/pallets/collab-ai/halving-mint/Cargo.toml @@ -11,6 +11,9 @@ version = '0.1.0' [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] +[lints] +workspace = true + [dependencies] parity-scale-codec = { workspace = true } scale-info = { workspace = true } diff --git a/parachain/pallets/halving-mint/src/lib.rs b/parachain/pallets/collab-ai/halving-mint/src/lib.rs similarity index 100% rename from parachain/pallets/halving-mint/src/lib.rs rename to parachain/pallets/collab-ai/halving-mint/src/lib.rs diff --git a/parachain/pallets/halving-mint/src/mock.rs b/parachain/pallets/collab-ai/halving-mint/src/mock.rs similarity index 76% rename from parachain/pallets/halving-mint/src/mock.rs rename to parachain/pallets/collab-ai/halving-mint/src/mock.rs index b19efabb58..469bef0343 100644 --- a/parachain/pallets/halving-mint/src/mock.rs +++ b/parachain/pallets/collab-ai/halving-mint/src/mock.rs @@ -17,13 +17,12 @@ use crate::{self as pallet_halving_mint, Config, Instance1, OnTokenMinted}; use frame_support::pallet_prelude::*; use frame_support::traits::tokens::{fungibles::Mutate, Preservation}; -use frame_support::{construct_runtime, parameter_types, traits::AsEnsureOriginWithArg, PalletId}; -use frame_system::{EnsureRoot, EnsureSigned}; -use sp_core::{ConstU32, ConstU64, H256}; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, +use frame_support::{ + construct_runtime, derive_impl, parameter_types, traits::AsEnsureOriginWithArg, PalletId, }; +use frame_system::{EnsureRoot, EnsureSigned}; +use sp_core::{ConstU32, ConstU64}; +use sp_runtime::BuildStorage; type AccountId = u64; type Balance = u64; @@ -39,34 +38,21 @@ construct_runtime!( } ); +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] +impl frame_system::Config for Test { + type Block = frame_system::mocking::MockBlock; + type AccountData = pallet_balances::AccountData; +} + parameter_types! { - pub const BlockHashCount: u32 = 250; + pub const ExistentialDeposit: Balance = 1; } -impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type Block = frame_system::mocking::MockBlock; - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] +impl pallet_balances::Config for Test { + type Balance = Balance; + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; } parameter_types! { @@ -101,27 +87,6 @@ impl pallet_assets::Config for Test { type BenchmarkHelper = (); } -parameter_types! { - pub const ExistentialDeposit: u64 = 2; - pub const MaxLocks: u32 = 10; -} - -impl pallet_balances::Config for Test { - type MaxLocks = (); - type Balance = u64; - type DustRemoval = (); - type RuntimeEvent = RuntimeEvent; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = (); - type MaxReserves = (); - type ReserveIdentifier = (); - type FreezeIdentifier = (); - type MaxHolds = (); - type MaxFreezes = (); - type RuntimeHoldReason = (); -} - parameter_types! { pub const BeneficiaryId: PalletId = PalletId(*b"lty/hlvm"); pub const TestAssetId: AssetId = 1; diff --git a/parachain/pallets/halving-mint/src/tests.rs b/parachain/pallets/collab-ai/halving-mint/src/tests.rs similarity index 100% rename from parachain/pallets/halving-mint/src/tests.rs rename to parachain/pallets/collab-ai/halving-mint/src/tests.rs diff --git a/parachain/pallets/halving-mint/src/traits.rs b/parachain/pallets/collab-ai/halving-mint/src/traits.rs similarity index 100% rename from parachain/pallets/halving-mint/src/traits.rs rename to parachain/pallets/collab-ai/halving-mint/src/traits.rs