mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 21:41:12 +00:00
refactor: inconsistent BalanceConversion fn (#13610)
* refactor: inconsistent BalanceConversion fn * Revert "refactor: inconsistent BalanceConversion fn" This reverts commit 1177877631a11b64df6f019b5390a8a7018e3a3f. * refactor: rename BalanceConversion trait * feat: add ConversionFromAssetBalance
This commit is contained in:
committed by
GitHub
parent
795fcf0484
commit
74bbae6901
@@ -22,7 +22,8 @@ use frame_support::{
|
||||
traits::{
|
||||
fungibles::{Balanced, Credit, Inspect},
|
||||
tokens::{
|
||||
Balance, BalanceConversion, Fortitude::Polite, Precision::Exact, Preservation::Protect,
|
||||
Balance, ConversionToAssetBalance, Fortitude::Polite, Precision::Exact,
|
||||
Preservation::Protect,
|
||||
},
|
||||
},
|
||||
unsigned::TransactionValidityError,
|
||||
@@ -87,7 +88,7 @@ impl<A, B: Balanced<A>> HandleCredit<A, B> for () {
|
||||
}
|
||||
|
||||
/// Implements the asset transaction for a balance to asset converter (implementing
|
||||
/// [`BalanceConversion`]) and a credit handler (implementing [`HandleCredit`]).
|
||||
/// [`ConversionToAssetBalance`]) and a credit handler (implementing [`HandleCredit`]).
|
||||
///
|
||||
/// The credit handler is given the complete fee in terms of the asset used for the transaction.
|
||||
pub struct FungiblesAdapter<CON, HC>(PhantomData<(CON, HC)>);
|
||||
@@ -97,7 +98,7 @@ pub struct FungiblesAdapter<CON, HC>(PhantomData<(CON, HC)>);
|
||||
impl<T, CON, HC> OnChargeAssetTransaction<T> for FungiblesAdapter<CON, HC>
|
||||
where
|
||||
T: Config,
|
||||
CON: BalanceConversion<BalanceOf<T>, AssetIdOf<T>, AssetBalanceOf<T>>,
|
||||
CON: ConversionToAssetBalance<BalanceOf<T>, AssetIdOf<T>, AssetBalanceOf<T>>,
|
||||
HC: HandleCredit<T::AccountId, T::Fungibles>,
|
||||
AssetIdOf<T>: FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default + Eq + TypeInfo,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user