Skip to content

Commit

Permalink
Feat/vtoken voting add vbnc (#1510)
Browse files Browse the repository at this point in the history
* Fix the bug related to the missing Ledger type.

* Remove the BNC restriction from the DerivativeAccountTokenFilter.

* Change the active logic of Ledger to total minus lesstotal.
  • Loading branch information
SunTiebing authored Nov 21, 2024
1 parent 96665fa commit f696225
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pallets/slp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2286,6 +2286,8 @@ impl<T: Config, F: Contains<CurrencyIdOf<T>>>
Self::get_multilocation(token, derivative_index).and_then(|location| {
DelegatorLedgers::<T>::get(token, location).and_then(|ledger| match ledger {
Ledger::Substrate(l) if F::contains(&token) => Some((l.total, l.active)),
Ledger::ParachainStaking(l) if F::contains(&token) =>
Some((l.total, l.total.checked_sub(&l.less_total).unwrap_or_default())),
_ => None,
})
})
Expand Down
4 changes: 2 additions & 2 deletions runtime/bifrost-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use bifrost_primitives::{
IncentivePalletId, IncentivePoolAccount, LendMarketPalletId, LiquidityAccount,
LocalBncLocation, MerkleDirtributorPalletId, OraclePalletId, ParachainStakingPalletId,
SlpEntrancePalletId, SlpExitPalletId, SystemMakerPalletId, SystemStakingPalletId,
TreasuryPalletId,
TreasuryPalletId, BNC,
};
use cumulus_pallet_parachain_system::{RelayNumberMonotonicallyIncreases, RelaychainDataProvider};
pub use frame_support::{
Expand Down Expand Up @@ -1313,7 +1313,7 @@ parameter_types! {
pub struct DerivativeAccountTokenFilter;
impl Contains<CurrencyId> for DerivativeAccountTokenFilter {
fn contains(token: &CurrencyId) -> bool {
*token == RelayCurrencyId::get()
*token == RelayCurrencyId::get() || *token == BNC
}
}

Expand Down

0 comments on commit f696225

Please sign in to comment.