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
32 changes: 0 additions & 32 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions node/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ bifrost-flexible-fee-rpc = { path = "../../pallets/flexible-fee/rpc" }
bifrost-flexible-fee-rpc-runtime-api = { path = "../../pallets/flexible-fee/rpc/runtime-api" }
bifrost-salp-rpc-api = { path = "../../pallets/salp/rpc" }
bifrost-salp-rpc-runtime-api = { path = "../../pallets/salp/rpc/runtime-api" }
bifrost-salp-lite-rpc-api = { path = "../../pallets/salp-lite/rpc" }
bifrost-salp-lite-rpc-runtime-api = { path = "../../pallets/salp-lite/rpc/runtime-api" }
bifrost-liquidity-mining-rpc-api = { path = "../../pallets/liquidity-mining/rpc" }
bifrost-liquidity-mining-rpc-runtime-api = { path = "../../pallets/liquidity-mining/rpc/runtime-api" }
zenlink-protocol-rpc = "*"
Expand Down
8 changes: 0 additions & 8 deletions node/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ use bifrost_flexible_fee_rpc::{FeeRpcApi, FlexibleFeeStruct};
use bifrost_flexible_fee_rpc_runtime_api::FlexibleFeeRuntimeApi as FeeRuntimeApi;
use bifrost_liquidity_mining_rpc_api::{LiquidityMiningRpcApi, LiquidityMiningRpcWrapper};
use bifrost_liquidity_mining_rpc_runtime_api::LiquidityMiningRuntimeApi;
use bifrost_salp_lite_rpc_api::{SalpLiteRpcApi, SalpLiteRpcWrapper};
use bifrost_salp_lite_rpc_runtime_api::SalpLiteRuntimeApi;
use bifrost_salp_rpc_api::{SalpRpcApi, SalpRpcWrapper};
use bifrost_salp_rpc_runtime_api::SalpRuntimeApi;
use node_primitives::{AccountId, Balance, Block, Nonce, ParaId, PoolId};
Expand Down Expand Up @@ -79,7 +77,6 @@ where
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
C::Api: FeeRuntimeApi<Block, AccountId>,
C::Api: SalpRuntimeApi<Block, ParaId, AccountId>,
C::Api: SalpLiteRuntimeApi<Block, ParaId, AccountId>,
C::Api: LiquidityMiningRuntimeApi<Block, AccountId, PoolId>,
C::Api: ZenlinkProtocolRuntimeApi<Block, AccountId>,
C::Api: BlockBuilder<Block>,
Expand All @@ -95,8 +92,6 @@ where

io.extend_with(SalpRpcApi::to_delegate(SalpRpcWrapper::new(client.clone())));

io.extend_with(SalpLiteRpcApi::to_delegate(SalpLiteRpcWrapper::new(client.clone())));

io.extend_with(LiquidityMiningRpcApi::to_delegate(LiquidityMiningRpcWrapper::new(
client.clone(),
)));
Expand All @@ -119,7 +114,6 @@ where
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
C::Api: FeeRuntimeApi<Block, AccountId>,
C::Api: SalpRuntimeApi<Block, ParaId, AccountId>,
C::Api: SalpLiteRuntimeApi<Block, ParaId, AccountId>,
C::Api: LiquidityMiningRuntimeApi<Block, AccountId, PoolId>,
C::Api: ZenlinkProtocolRuntimeApi<Block, AccountId>,
C::Api: BlockBuilder<Block>,
Expand All @@ -135,8 +129,6 @@ where

io.extend_with(SalpRpcApi::to_delegate(SalpRpcWrapper::new(client.clone())));

io.extend_with(SalpLiteRpcApi::to_delegate(SalpLiteRpcWrapper::new(client.clone())));

io.extend_with(LiquidityMiningRpcApi::to_delegate(LiquidityMiningRpcWrapper::new(
client.clone(),
)));
Expand Down
1 change: 0 additions & 1 deletion node/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ zenlink-protocol-runtime-api = "*"
# Bifrost rpc
bifrost-flexible-fee-rpc-runtime-api = { path = "../../pallets/flexible-fee/rpc/runtime-api" }
bifrost-salp-rpc-runtime-api = { path = "../../pallets/salp/rpc/runtime-api" }
bifrost-salp-lite-rpc-runtime-api = { path = "../../pallets/salp-lite/rpc/runtime-api" }
bifrost-liquidity-mining-rpc-runtime-api = { path = "../../pallets/liquidity-mining/rpc/runtime-api" }

[features]
Expand Down
2 changes: 0 additions & 2 deletions node/service/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ pub trait RuntimeApiCollection:
+ bifrost_flexible_fee_rpc_runtime_api::FlexibleFeeRuntimeApi<Block, AccountId>
+ bifrost_liquidity_mining_rpc_runtime_api::LiquidityMiningRuntimeApi<Block, AccountId, PoolId>
+ bifrost_salp_rpc_runtime_api::SalpRuntimeApi<Block, BifrostParaId, AccountId>
+ bifrost_salp_lite_rpc_runtime_api::SalpLiteRuntimeApi<Block, BifrostParaId, AccountId>
+ zenlink_protocol_runtime_api::ZenlinkProtocolApi<Block, AccountId>
where
<Self as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>,
Expand All @@ -75,7 +74,6 @@ where
AccountId,
PoolId,
> + bifrost_salp_rpc_runtime_api::SalpRuntimeApi<Block, BifrostParaId, AccountId>
+ bifrost_salp_lite_rpc_runtime_api::SalpLiteRuntimeApi<Block, BifrostParaId, AccountId>
+ zenlink_protocol_runtime_api::ZenlinkProtocolApi<Block, AccountId>,
<Self as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>,
{
Expand Down
19 changes: 0 additions & 19 deletions pallets/salp-lite/rpc/Cargo.toml

This file was deleted.

18 changes: 0 additions & 18 deletions pallets/salp-lite/rpc/runtime-api/Cargo.toml

This file was deleted.

35 changes: 0 additions & 35 deletions pallets/salp-lite/rpc/runtime-api/src/lib.rs

This file was deleted.

86 changes: 0 additions & 86 deletions pallets/salp-lite/rpc/src/lib.rs

This file was deleted.

32 changes: 0 additions & 32 deletions pallets/salp-lite/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,38 +72,6 @@ benchmarks! {
assert_last_event::<T>(Event::<T>::Refunded(caller.clone(), fund_index, contribution).into())
}

unlock {
let fund_index = create_fund::<T>(1);
let caller: T::AccountId = whitelisted_caller();
let caller_origin: T::Origin = RawOrigin::Signed(caller.clone()).into();
let contribution = T::MinContribution::get();
contribute_fund::<T>(&caller,fund_index);
assert_ok!(Salp::<T>::fund_success(RawOrigin::Root.into(), fund_index));
}: _(RawOrigin::Root, caller.clone(),fund_index)
verify {
let fund = Salp::<T>::funds(fund_index).unwrap();
let (_, status) = Salp::<T>::contribution(fund.trie_index, &caller);
assert_eq!(status, ContributionStatus::Unlocked);
}

batch_unlock {
let k in 1 .. T::BatchKeysLimit::get();
let fund_index = create_fund::<T>(1);
let contribution = T::MinContribution::get();
let mut caller: T::AccountId = whitelisted_caller();
for i in 0 .. k {
caller = account("contributor", i, 0);
contribute_fund::<T>(&caller,fund_index);
}
assert_ok!(Salp::<T>::fund_success(RawOrigin::Root.into(), fund_index));
}: _(RawOrigin::Signed(caller.clone()), fund_index)
verify {
let fund = Salp::<T>::funds(fund_index).unwrap();
let (_, status) = Salp::<T>::contribution(fund.trie_index, &caller);
assert_eq!(status, ContributionStatus::Unlocked);
assert_last_event::<T>(Event::<T>::AllUnlocked(fund_index).into());
}

redeem {
let fund_index = create_fund::<T>(1);
let caller: T::AccountId = whitelisted_caller();
Expand Down
19 changes: 4 additions & 15 deletions pallets/salp-lite/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
// Ensure we're `no_std` when compiling for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]

pub mod migration {
pub fn migrate() {
log::info!("salp migration...");
}
}

#[cfg(feature = "runtime-benchmarks")]
pub mod benchmarking;
#[cfg(test)]
Expand Down Expand Up @@ -106,7 +100,7 @@ pub mod pallet {
use super::*;

#[pallet::config]
pub trait Config: frame_system::Config<BlockNumber = LeasePeriod> + TypeInfo {
pub trait Config: frame_system::Config<BlockNumber = LeasePeriod> {
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;

/// ModuleID for the crowdloan module. An appropriate value could be
Expand Down Expand Up @@ -382,7 +376,7 @@ pub mod pallet {
}

/// Unlock the reserved vsToken/vsBond after fund success
#[pallet::weight(T::WeightInfo::batch_unlock(T::BatchKeysLimit::get()))]
#[pallet::weight(T::WeightInfo::batch_migrate(T::BatchKeysLimit::get()))]
#[transactional]
pub fn batch_migrate(
origin: OriginFor<T>,
Expand Down Expand Up @@ -807,19 +801,14 @@ pub mod pallet {
}

pub trait WeightInfo {
fn unlock() -> Weight;
fn batch_unlock(k: u32) -> Weight;
fn batch_migrate(k: u32) -> Weight;
fn refund() -> Weight;
fn redeem() -> Weight;
}

// For backwards compatibility and tests
impl WeightInfo for () {
fn unlock() -> Weight {
50_000_000 as Weight
}

fn batch_unlock(_k: u32) -> Weight {
fn batch_migrate(_k: u32) -> Weight {
50_000_000 as Weight
}

Expand Down
Loading