Change order of events emitted from transfer. (#4301)

This commit is contained in:
Shawn Tabrizi
2019-12-05 16:05:54 +01:00
committed by Gavin Wood
parent af3fc1d95a
commit 5e6f339a97
+6 -1
View File
@@ -934,9 +934,14 @@ where
if !<FreeBalance<T, I>>::exists(dest) {
Self::new_account(dest, new_to_balance);
}
// Emit transfer event.
Self::deposit_event(RawEvent::Transfer(transactor.clone(), dest.clone(), value, fee));
// Take action on the set_free_balance call.
// This will emit events that _resulted_ from the transfer.
Self::set_free_balance(dest, new_to_balance);
T::TransferPayment::on_unbalanced(NegativeImbalance::new(fee));
Self::deposit_event(RawEvent::Transfer(transactor.clone(), dest.clone(), value, fee));
}
Ok(())