Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions frame/assets/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down
6 changes: 0 additions & 6 deletions frame/assets/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,12 +620,6 @@ 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 {
Comment thread
ggwpez marked this conversation as resolved.
asset_id: 0,
from: 1,
to: 2,
amount: 0,
}));
});
}

Expand Down