From 5df269cc38001347e76b29129ddd8cfd5a5d71ca Mon Sep 17 00:00:00 2001 From: hqwangningbo <2536935847@qq.com> Date: Wed, 7 Feb 2024 16:01:40 +0800 Subject: [PATCH] Slpx support vmanta --- Cargo.lock | 2 +- node/cli/Cargo.toml | 2 +- pallets/slpx/src/lib.rs | 4 +- runtime/bifrost-kusama/src/lib.rs | 35 ++------- runtime/bifrost-polkadot/src/lib.rs | 108 ++-------------------------- 5 files changed, 12 insertions(+), 139 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 938014972..8840cff26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -917,7 +917,7 @@ dependencies = [ [[package]] name = "bifrost-cli" -version = "0.9.92" +version = "0.9.93" dependencies = [ "bifrost-primitives", "bifrost-service", diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 1ae1c3033..d62839e81 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bifrost-cli" -version = "0.9.92" +version = "0.9.93" authors = ["Liebi Technologies "] description = "Bifrost Parachain Node" build = "build.rs" diff --git a/pallets/slpx/src/lib.rs b/pallets/slpx/src/lib.rs index bea1c3755..ceae9b990 100644 --- a/pallets/slpx/src/lib.rs +++ b/pallets/slpx/src/lib.rs @@ -24,7 +24,7 @@ use crate::types::{ }; use bifrost_asset_registry::AssetMetadata; use bifrost_primitives::{ - currency::{BNC, FIL, VBNC, VDOT, VFIL, VGLMR, VKSM, VMOVR}, + currency::{BNC, FIL, VBNC, VDOT, VFIL, VGLMR, VKSM, VMANTA, VMOVR}, CurrencyId, CurrencyIdMapping, SlpxOperator, TokenInfo, TryConvertFrom, VtokenMintingInterface, }; use cumulus_primitives_core::ParaId; @@ -942,7 +942,7 @@ impl Pallet { let fee_amount = Self::transfer_to_fee(SupportChain::Moonbeam) .unwrap_or_else(|| Self::get_default_fee(BNC)); match currency_id { - VKSM | VMOVR | VBNC | FIL | VFIL | VDOT | VGLMR => { + VKSM | VMOVR | VBNC | FIL | VFIL | VDOT | VGLMR | VMANTA => { T::MultiCurrency::transfer( BNC, evm_contract_account_id, diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index fc5b8cc69..f512aa690 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -107,8 +107,8 @@ use zenlink_stable_amm::traits::{StableAmmApi, StablePoolLpCurrencyIdGenerate, V // Governance configurations. pub mod governance; use governance::{ - custom_origins, fellowship::FellowshipReferendaInstance, CoreAdmin, CoreAdminOrCouncil, - LiquidStaking, SALPAdmin, Spender, TechAdmin, TechAdminOrCouncil, + custom_origins, CoreAdmin, CoreAdminOrCouncil, LiquidStaking, SALPAdmin, Spender, TechAdmin, + TechAdminOrCouncil, }; // xcm config @@ -134,7 +134,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bifrost"), impl_name: create_runtime_str!("bifrost"), authoring_version: 1, - spec_version: 992, + spec_version: 993, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -2038,35 +2038,8 @@ pub type Migrations = migrations::Unreleased; /// The runtime migrations per release. pub mod migrations { - use super::*; - /// Unreleased migrations. Add new ones here: - pub type Unreleased = ( - pallet_referenda::migration::v1::MigrateV0ToV1, - pallet_referenda::migration::v1::MigrateV0ToV1, - OracleMembershipStoragePrefixMigration, - PhragmenElectionDepositRuntimeUpgrade, - ); -} - -use frame_support::traits::{GetStorageVersion, OnRuntimeUpgrade, StorageVersion}; -pub struct PhragmenElectionDepositRuntimeUpgrade; -impl frame_support::traits::OnRuntimeUpgrade for PhragmenElectionDepositRuntimeUpgrade { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - StorageVersion::new(4).put::(); - RocksDbWeight::get().reads_writes(1, 1) - } -} - -pub struct OracleMembershipStoragePrefixMigration; -impl OnRuntimeUpgrade for OracleMembershipStoragePrefixMigration { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - let storage_version = OracleMembership::on_chain_storage_version(); - if storage_version < 4 { - StorageVersion::new(4).put::(); - } - RocksDbWeight::get().reads_writes(1, 1) - } + pub type Unreleased = (); } /// Executive: handles dispatch to the various modules. diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index ca1004e8f..b42b3a53d 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -117,8 +117,8 @@ use xcm_executor::{ pub mod governance; use crate::xcm_config::XcmRouter; use governance::{ - custom_origins, fellowship::FellowshipReferendaInstance, CoreAdminOrCouncil, LiquidStaking, - SALPAdmin, Spender, TechAdmin, TechAdminOrCouncil, + custom_origins, CoreAdminOrCouncil, LiquidStaking, SALPAdmin, Spender, TechAdmin, + TechAdminOrCouncil, }; impl_opaque_keys! { @@ -133,7 +133,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bifrost_polkadot"), impl_name: create_runtime_str!("bifrost_polkadot"), authoring_version: 0, - spec_version: 992, + spec_version: 993, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -1843,108 +1843,8 @@ pub type Migrations = migrations::Unreleased; /// The runtime migrations per release. pub mod migrations { - use super::*; - /// Unreleased migrations. Add new ones here: - pub type Unreleased = ( - pallet_referenda::migration::v1::MigrateV0ToV1, - pallet_referenda::migration::v1::MigrateV0ToV1, - OracleMembershipMigration, - PhragmenElectionDepositRuntimeUpgrade, - TechnicalCommitteeMigration, - CouncilMigration, - pallet_collator_selection::migration::v1::MigrateToV1, - CouncilMembershipMigration, - TechnicalMembershipMigration, - BountiesMigration, - TipsMigration, - ); -} - -use frame_support::traits::{GetStorageVersion, OnRuntimeUpgrade, StorageVersion}; -pub struct PhragmenElectionDepositRuntimeUpgrade; -impl frame_support::traits::OnRuntimeUpgrade for PhragmenElectionDepositRuntimeUpgrade { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - StorageVersion::new(4).put::(); - RocksDbWeight::get().reads_writes(1, 1) - } -} - -pub struct OracleMembershipMigration; -impl OnRuntimeUpgrade for OracleMembershipMigration { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - let storage_version = OracleMembership::on_chain_storage_version(); - if storage_version < 4 { - StorageVersion::new(4).put::(); - } - RocksDbWeight::get().reads_writes(1, 1) - } -} - -pub struct CouncilMembershipMigration; -impl OnRuntimeUpgrade for CouncilMembershipMigration { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - let storage_version = CouncilMembership::on_chain_storage_version(); - if storage_version < 4 { - StorageVersion::new(4).put::(); - } - RocksDbWeight::get().reads_writes(1, 1) - } -} - -pub struct TechnicalMembershipMigration; -impl OnRuntimeUpgrade for TechnicalMembershipMigration { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - let storage_version = TechnicalMembership::on_chain_storage_version(); - if storage_version < 4 { - StorageVersion::new(4).put::(); - } - RocksDbWeight::get().reads_writes(1, 1) - } -} - -pub struct TechnicalCommitteeMigration; -impl OnRuntimeUpgrade for TechnicalCommitteeMigration { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - let storage_version = TechnicalCommittee::on_chain_storage_version(); - if storage_version < 4 { - StorageVersion::new(4).put::(); - } - RocksDbWeight::get().reads_writes(1, 1) - } -} - -pub struct CouncilMigration; -impl OnRuntimeUpgrade for CouncilMigration { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - let storage_version = Council::on_chain_storage_version(); - if storage_version < 4 { - StorageVersion::new(4).put::(); - } - RocksDbWeight::get().reads_writes(1, 1) - } -} - -pub struct BountiesMigration; -impl OnRuntimeUpgrade for BountiesMigration { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - let storage_version = Bounties::on_chain_storage_version(); - if storage_version < 4 { - StorageVersion::new(4).put::(); - } - RocksDbWeight::get().reads_writes(1, 1) - } -} - -pub struct TipsMigration; -impl OnRuntimeUpgrade for TipsMigration { - fn on_runtime_upgrade() -> frame_support::weights::Weight { - let storage_version = Tips::on_chain_storage_version(); - if storage_version < 4 { - StorageVersion::new(4).put::(); - } - RocksDbWeight::get().reads_writes(1, 1) - } + pub type Unreleased = (); } /// Executive: handles dispatch to the various modules.