diff --git a/substrate/frame/assets/src/functions.rs b/substrate/frame/assets/src/functions.rs index 48a86ca3cfa04478418d662b2dccd78eb2f019b8..0be79619e09674591b5d9e9ae5423a425b26beb4 100644 --- a/substrate/frame/assets/src/functions.rs +++ b/substrate/frame/assets/src/functions.rs @@ -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)) } diff --git a/substrate/frame/assets/src/tests.rs b/substrate/frame/assets/src/tests.rs index 7430b742e7d2af1e0790ced0a1179bd7e2caacb2..db0d6a5f212f91a8928dff0048c6f12f3a301266 100644 --- a/substrate/frame/assets/src/tests.rs +++ b/substrate/frame/assets/src/tests.rs @@ -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); }); }