difftreelog
fix fungible transfer
in: master
1 file changed
pallets/fungible/src/lib.rsdiffbeforeafterboth379 let balance_from = <Balance<T>>::get((collection.id, from))379 let balance_from = <Balance<T>>::get((collection.id, from))380 .checked_sub(amount)380 .checked_sub(amount)381 .ok_or(<CommonError<T>>::TokenValueTooLow)?;381 .ok_or(<CommonError<T>>::TokenValueTooLow)?;382 let balance_to = if from != to {382 let balance_to = if from != to && amount != 0 {383 Some(383 Some(384 <Balance<T>>::get((collection.id, to))384 <Balance<T>>::get((collection.id, to))385 .checked_add(amount)385 .checked_add(amount)391391392 // =========392 // =========393394 if let Some(balance_to) = balance_to {395 // from != to && amount != 0393396394 <PalletStructure<T>>::nest_if_sent_to_token(397 <PalletStructure<T>>::nest_if_sent_to_token(395 from.clone(),398 from.clone(),399 nesting_budget,402 nesting_budget,400 )?;403 )?;401404402 if let Some(balance_to) = balance_to {403 // from != to404 if balance_from == 0 {405 if balance_from == 0 {405 <Balance<T>>::remove((collection.id, from));406 <Balance<T>>::remove((collection.id, from));406 <PalletStructure<T>>::unnest_if_nested(from, collection.id, TokenId::default());407 <PalletStructure<T>>::unnest_if_nested(from, collection.id, TokenId::default());407 } else {408 } else {408 <Balance<T>>::insert((collection.id, from), balance_from);409 <Balance<T>>::insert((collection.id, from), balance_from);409 }410 }410 <Balance<T>>::insert((collection.id, to), balance_to);411 <Balance<T>>::insert((collection.id, to), balance_to);411 }412 }412413413 <PalletEvm<T>>::deposit_log(414 <PalletEvm<T>>::deposit_log(414 ERC20Events::Transfer {415 ERC20Events::Transfer {