Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Cargo.lock

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

11 changes: 4 additions & 7 deletions node/service/src/chain_spec/bifrost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ use std::{
};

use bifrost_runtime::{
constants::currency::DOLLARS, AccountId, AuraId, Balance, BalancesConfig, BancorConfig,
BlockNumber, CollatorSelectionConfig, CouncilConfig, DemocracyConfig, GenesisConfig,
IndicesConfig, ParachainInfoConfig, SessionConfig, SudoConfig, SystemConfig,
TechnicalCommitteeConfig, TokensConfig, VestingConfig, WASM_BINARY,
constants::currency::DOLLARS, AccountId, AuraId, Balance, BalancesConfig, BlockNumber,
CollatorSelectionConfig, CouncilConfig, DemocracyConfig, GenesisConfig, IndicesConfig,
ParachainInfoConfig, SessionConfig, SudoConfig, SystemConfig, TechnicalCommitteeConfig,
TokensConfig, VestingConfig, WASM_BINARY,
};
use cumulus_primitives_core::ParaId;
use frame_benchmarking::{account, whitelisted_caller};
Expand Down Expand Up @@ -98,9 +98,6 @@ pub fn bifrost_genesis(
parachain_system: Default::default(),
vesting: VestingConfig { vesting: vestings },
tokens: TokensConfig { balances: tokens },
bancor: BancorConfig {
bancor_pools: vec![(CurrencyId::Token(TokenSymbol::KSM), 1_000_000 * DOLLARS)],
},
}
}

Expand Down
5 changes: 0 additions & 5 deletions runtime/bifrost/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "releas
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9", default-features = false }

# Bifrost
bifrost-bancor = { path = "../../pallets/bancor", default-features = false }
bifrost-bancor-runtime-api = { path = "../../pallets/bancor/rpc/runtime-api", default-features = false }
bifrost-flexible-fee = { path = "../../pallets/flexible-fee", default-features = false }
bifrost-flexible-fee-rpc-runtime-api = { path = "../../pallets/flexible-fee/rpc/runtime-api", default-features = false }
bifrost-runtime-common = { package = "bifrost-runtime-common", path = "../common", default-features = false }
Expand Down Expand Up @@ -163,8 +161,6 @@ std = [
"bifrost-runtime-common/std",
"bifrost-flexible-fee/std",
"bifrost-flexible-fee-rpc-runtime-api/std",
"bifrost-bancor/std",
"bifrost-bancor-runtime-api/std",
"bifrost-salp/std",
"bifrost-salp-rpc-runtime-api/std",
]
Expand All @@ -189,7 +185,6 @@ runtime-benchmarks = [
"xcm-builder/runtime-benchmarks",
"bifrost-flexible-fee/runtime-benchmarks",
"bifrost-salp/runtime-benchmarks",
"bifrost-bancor/runtime-benchmarks",
]

try-runtime = [
Expand Down
51 changes: 1 addition & 50 deletions runtime/bifrost/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ parameter_types! {
}

impl bifrost_salp::Config for Runtime {
type BancorPool = Bancor;
type BancorPool = ();
type BifrostXcmExecutor = BifrostXcmAdaptor<XcmRouter, XcmWeight, WeightToFee>;
type Event = Event;
type LeasePeriod = LeasePeriod;
Expand Down Expand Up @@ -1042,19 +1042,6 @@ impl bifrost_salp::Config for Runtime {
type TransactType = SalpTransactType;
}

parameter_types! {
pub const InterventionPercentage: Percent = Percent::from_percent(75);
pub const DailyReleasePercentage: Percent = Percent::from_percent(5);
}

impl bifrost_bancor::Config for Runtime {
type Event = Event;
type InterventionPercentage = InterventionPercentage;
type DailyReleasePercentage = DailyReleasePercentage;
type MultiCurrency = Currencies;
type WeightInfo = weights::bifrost_bancor::WeightInfo<Runtime>;
}

// Bifrost modules end

construct_runtime! {
Expand Down Expand Up @@ -1119,7 +1106,6 @@ construct_runtime! {
// Bifrost modules
FlexibleFee: bifrost_flexible_fee::{Pallet, Call, Storage, Event<T>} = 100,
Salp: bifrost_salp::{Pallet, Call, Storage, Event<T>} = 105,
Bancor: bifrost_bancor::{Pallet, Call, Storage, Event<T>, Config<T>} = 106,
}
}

Expand Down Expand Up @@ -1286,40 +1272,6 @@ impl_runtime_apis! {
}
}

impl bifrost_bancor_runtime_api::BancorRuntimeApi<Block, CurrencyId, Balance> for Runtime {
fn get_bancor_token_amount_out(token_id: CurrencyId, vstoken_amount: Balance) -> Balance {
let rs = Bancor::calculate_price_for_token(token_id, vstoken_amount);
match rs {
Ok(val) => val,
_ => Zero::zero(),
}
}

fn get_bancor_vstoken_amount_out(token_id: CurrencyId, token_amount: Balance) -> Balance {
let rs = Bancor::calculate_price_for_vstoken(token_id, token_amount);
match rs {
Ok(val) => val,
_ => Zero::zero(),
}
}

fn get_instant_vstoken_price(currency_id: CurrencyId) -> (Balance, Balance) {
let rs = Bancor::get_instant_vstoken_price(currency_id);
match rs {
Ok((nominator, denominator)) => (nominator, denominator),
_ => (Zero::zero(), Zero::zero()),
}
}

fn get_instant_token_price(currency_id: CurrencyId) -> (Balance, Balance) {
let rs = Bancor::get_instant_token_price(currency_id);
match rs {
Ok((nominator, denominator)) => (nominator, denominator),
_ => (Zero::zero(), Zero::zero()),
}
}
}

impl bifrost_salp_rpc_runtime_api::SalpRuntimeApi<Block, ParaId, AccountId> for Runtime {
fn get_contribution(index: ParaId, who: AccountId) -> (Balance,RpcContributionStatus) {
let rs = Salp::contribution_by_fund(index, &who);
Expand All @@ -1341,7 +1293,6 @@ impl_runtime_apis! {

let mut list = Vec::<BenchmarkList>::new();

list_benchmark!(list, extra, bifrost_bancor, Bancor);
list_benchmark!(list, extra, bifrost_flexible_fee, FlexibleFee);
list_benchmark!(list, extra, bifrost_salp, Salp);

Expand Down
66 changes: 0 additions & 66 deletions runtime/bifrost/src/weights/bifrost_bancor.rs

This file was deleted.

1 change: 0 additions & 1 deletion runtime/bifrost/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

//! A list of the different weight modules for our runtime.

pub mod bifrost_bancor;
pub mod bifrost_flexible_fee;
pub mod bifrost_salp;
pub mod frame_system;
Expand Down