mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-22 19:35:43 +00:00
pallet_assets : Remove event for no_op (#11023)
* remove no_op event * ensure no transferred event emitted Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
@@ -529,14 +529,8 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
|||||||
maybe_need_admin: Option<T::AccountId>,
|
maybe_need_admin: Option<T::AccountId>,
|
||||||
f: TransferFlags,
|
f: TransferFlags,
|
||||||
) -> Result<(T::Balance, Option<DeadConsequence>), DispatchError> {
|
) -> Result<(T::Balance, Option<DeadConsequence>), DispatchError> {
|
||||||
// Early exist if no-op.
|
// Early exit if no-op.
|
||||||
if amount.is_zero() {
|
if amount.is_zero() {
|
||||||
Self::deposit_event(Event::Transferred {
|
|
||||||
asset_id: id,
|
|
||||||
from: source.clone(),
|
|
||||||
to: dest.clone(),
|
|
||||||
amount,
|
|
||||||
});
|
|
||||||
return Ok((amount, None))
|
return Ok((amount, None))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -620,12 +620,8 @@ fn transferring_less_than_one_unit_is_fine() {
|
|||||||
assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100));
|
assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100));
|
||||||
assert_eq!(Assets::balance(0, 1), 100);
|
assert_eq!(Assets::balance(0, 1), 100);
|
||||||
assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 0));
|
assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 0));
|
||||||
System::assert_last_event(mock::Event::Assets(crate::Event::Transferred {
|
// `ForceCreated` and `Issued` but no `Transferred` event.
|
||||||
asset_id: 0,
|
assert_eq!(System::events().len(), 2);
|
||||||
from: 1,
|
|
||||||
to: 2,
|
|
||||||
amount: 0,
|
|
||||||
}));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user