Skip to content
Snippets Groups Projects
Commit 7dca0e46 authored by stanly-johnson's avatar stanly-johnson Committed by GitHub
Browse files

pallet_assets : Remove event for no_op (#11023)


* remove no_op event

* ensure no transferred event emitted

Co-authored-by: default avatarOliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
parent c56e8f68
Branches
No related merge requests found
......@@ -529,14 +529,8 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
maybe_need_admin: Option<T::AccountId>,
f: TransferFlags,
) -> Result<(T::Balance, Option<DeadConsequence>), DispatchError> {
// Early exist if no-op.
// Early exit if no-op.
if amount.is_zero() {
Self::deposit_event(Event::Transferred {
asset_id: id,
from: source.clone(),
to: dest.clone(),
amount,
});
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_eq!(Assets::balance(0, 1), 100);
assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 0));
System::assert_last_event(mock::Event::Assets(crate::Event::Transferred {
asset_id: 0,
from: 1,
to: 2,
amount: 0,
}));
// `ForceCreated` and `Issued` but no `Transferred` event.
assert_eq!(System::events().len(), 2);
});
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment