mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 12:11:09 +00:00
[FRAME] Short-circuit fungible self transfer (#2118)
Changes: - Change the fungible(s) logic to treat a self-transfer as No-OP (as long as all pre-checks pass). Note that the self-transfer case will not emit an event since no state was changed. --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
committed by
GitHub
parent
4f05f9a686
commit
c66ae375e6
@@ -102,7 +102,7 @@ struct AssetTraderRefunder {
|
||||
/// Important: Errors if the Trader is being called twice by 2 BuyExecution instructions
|
||||
/// Alternatively we could just return payment in the aforementioned case
|
||||
pub struct TakeFirstAssetTrader<
|
||||
AccountId,
|
||||
AccountId: Eq,
|
||||
FeeCharger: ChargeWeightInFungibles<AccountId, ConcreteAssets>,
|
||||
Matcher: MatchesFungibles<ConcreteAssets::AssetId, ConcreteAssets::Balance>,
|
||||
ConcreteAssets: fungibles::Mutate<AccountId> + fungibles::Balanced<AccountId>,
|
||||
@@ -112,7 +112,7 @@ pub struct TakeFirstAssetTrader<
|
||||
PhantomData<(AccountId, FeeCharger, Matcher, ConcreteAssets, HandleRefund)>,
|
||||
);
|
||||
impl<
|
||||
AccountId,
|
||||
AccountId: Eq,
|
||||
FeeCharger: ChargeWeightInFungibles<AccountId, ConcreteAssets>,
|
||||
Matcher: MatchesFungibles<ConcreteAssets::AssetId, ConcreteAssets::Balance>,
|
||||
ConcreteAssets: fungibles::Mutate<AccountId> + fungibles::Balanced<AccountId>,
|
||||
@@ -241,7 +241,7 @@ impl<
|
||||
}
|
||||
|
||||
impl<
|
||||
AccountId,
|
||||
AccountId: Eq,
|
||||
FeeCharger: ChargeWeightInFungibles<AccountId, ConcreteAssets>,
|
||||
Matcher: MatchesFungibles<ConcreteAssets::AssetId, ConcreteAssets::Balance>,
|
||||
ConcreteAssets: fungibles::Mutate<AccountId> + fungibles::Balanced<AccountId>,
|
||||
|
||||
Reference in New Issue
Block a user