Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove mint param
  • Loading branch information
apopiak committed May 29, 2022
commit 34f50fc5c2399a9820ba69371a809147efb9b354
9 changes: 4 additions & 5 deletions tokens/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ where
}
}

fn can_deposit(asset: Self::AssetId, who: &AccountId, amount: Self::Balance, mint: bool) -> DepositConsequence {
fn can_deposit(asset: Self::AssetId, who: &AccountId, amount: Self::Balance) -> DepositConsequence {
if TestKey::contains(&asset) {
A::can_deposit(who, amount, mint)
A::can_deposit(who, amount)
} else {
B::can_deposit(asset, who, amount, mint)
B::can_deposit(asset, who, amount)
}
}

Expand Down Expand Up @@ -156,12 +156,11 @@ where
)
}

fn can_deposit(who: &AccountId, amount: Self::Balance, mint: bool) -> DepositConsequence {
fn can_deposit(who: &AccountId, amount: Self::Balance) -> DepositConsequence {
T::can_deposit(
GetCurrencyId::get(),
who,
C::convert_balance_back(amount, GetCurrencyId::get()),
mint,
)
}

Expand Down
5 changes: 2 additions & 3 deletions tokens/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,6 @@ impl<T: Config> fungibles::Inspect<T::AccountId> for Pallet<T> {
asset_id: Self::AssetId,
who: &T::AccountId,
amount: Self::Balance,
_mint: bool,
) -> DepositConsequence {
Self::deposit_consequence(who, asset_id, amount, &Self::accounts(who, asset_id))
}
Expand Down Expand Up @@ -2169,8 +2168,8 @@ where
fn reducible_balance(who: &T::AccountId, keep_alive: bool) -> Self::Balance {
<Pallet<T> as fungibles::Inspect<_>>::reducible_balance(GetCurrencyId::get(), who, keep_alive)
}
fn can_deposit(who: &T::AccountId, amount: Self::Balance, mint: bool) -> DepositConsequence {
<Pallet<T> as fungibles::Inspect<_>>::can_deposit(GetCurrencyId::get(), who, amount, mint)
fn can_deposit(who: &T::AccountId, amount: Self::Balance) -> DepositConsequence {
<Pallet<T> as fungibles::Inspect<_>>::can_deposit(GetCurrencyId::get(), who, amount)
}
fn can_withdraw(who: &T::AccountId, amount: Self::Balance) -> WithdrawConsequence<Self::Balance> {
<Pallet<T> as fungibles::Inspect<_>>::can_withdraw(GetCurrencyId::get(), who, amount)
Expand Down
2 changes: 1 addition & 1 deletion tokens/src/tests_fungibles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn fungibles_inspect_trait_should_work() {
<Tokens as fungibles::Inspect<_>>::reducible_balance(DOT, &ALICE, true),
98
);
assert_ok!(<Tokens as fungibles::Inspect<_>>::can_deposit(DOT, &ALICE, 1, false).into_result());
assert_ok!(<Tokens as fungibles::Inspect<_>>::can_deposit(DOT, &ALICE, 1).into_result());
assert_ok!(<Tokens as fungibles::Inspect<_>>::can_withdraw(DOT, &ALICE, 1).into_result());
});
}
Expand Down