Skip to content

Commit

Permalink
do not emit CoinBalanceChange for ObjectOwner (MystenLabs#6499)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkuo authored Dec 1, 2022
1 parent 2a0b8e8 commit bcb77b8
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions crates/sui-types/src/temporary_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,17 +254,21 @@ impl<S> TemporaryStore<S> {
(WriteKind::Mutate, Ok(Some(_)), Some(old_obj)) => {
Self::create_coin_mutate_events(&ctx, gas_id, obj, old_obj, gas_charged)
}
// For all other coin change (unwrap/create), we emit full balance transfer event to the new owner.
// For all other coin change (unwrap/create), we emit full balance transfer event to the new address owner.
(_, Ok(Some(balance)), _) => {
vec![Event::balance_change(
&ctx,
BalanceChangeType::Receive,
obj.owner,
obj.id(),
obj.version(),
obj.type_().unwrap(),
balance as i128,
)]
if let Owner::AddressOwner(_) = obj.owner {
vec![Event::balance_change(
&ctx,
BalanceChangeType::Receive,
obj.owner,
obj.id(),
obj.version(),
obj.type_().unwrap(),
balance as i128,
)]
} else {
vec![]
}
}
// For non-coin mutation
(WriteKind::Mutate, Ok(None), old_obj) | (WriteKind::Unwrap, Ok(None), old_obj) => {
Expand Down

0 comments on commit bcb77b8

Please sign in to comment.