Skip to content

Commit

Permalink
Slpx support vmanta
Browse files Browse the repository at this point in the history
  • Loading branch information
hqwangningbo committed Feb 7, 2024
1 parent 6f7249d commit 5df269c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 139 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bifrost-cli"
version = "0.9.92"
version = "0.9.93"
authors = ["Liebi Technologies <[email protected]>"]
description = "Bifrost Parachain Node"
build = "build.rs"
Expand Down
4 changes: 2 additions & 2 deletions pallets/slpx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -942,7 +942,7 @@ impl<T: Config> Pallet<T> {
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,
Expand Down
35 changes: 4 additions & 31 deletions runtime/bifrost-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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<Runtime>,
pallet_referenda::migration::v1::MigrateV0ToV1<Runtime, FellowshipReferendaInstance>,
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::<PhragmenElection>();
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::<OracleMembership>();
}
RocksDbWeight::get().reads_writes(1, 1)
}
pub type Unreleased = ();
}

/// Executive: handles dispatch to the various modules.
Expand Down
108 changes: 4 additions & 104 deletions runtime/bifrost-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand All @@ -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,
Expand Down Expand Up @@ -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<Runtime>,
pallet_referenda::migration::v1::MigrateV0ToV1<Runtime, FellowshipReferendaInstance>,
OracleMembershipMigration,
PhragmenElectionDepositRuntimeUpgrade,
TechnicalCommitteeMigration,
CouncilMigration,
pallet_collator_selection::migration::v1::MigrateToV1<Runtime>,
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::<PhragmenElection>();
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::<OracleMembership>();
}
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::<CouncilMembership>();
}
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::<TechnicalMembership>();
}
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::<TechnicalCommittee>();
}
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::<Council>();
}
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::<Bounties>();
}
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::<Tips>();
}
RocksDbWeight::get().reads_writes(1, 1)
}
pub type Unreleased = ();
}

/// Executive: handles dispatch to the various modules.
Expand Down

0 comments on commit 5df269c

Please sign in to comment.