difftreelog
fix unnest tokens on transfer
in: master
3 files changed
pallets/fungible/src/lib.rsdiffbeforeafterboth256 // from != to256 // from != to257 if balance_from == 0 {257 if balance_from == 0 {258 <Balance<T>>::remove((collection.id, from));258 <Balance<T>>::remove((collection.id, from));259 <PalletStructure<T>>::unnest_if_nested(260 from,261 collection.id,262 TokenId::default()263 );259 } else {264 } else {260 <Balance<T>>::insert((collection.id, from), balance_from);265 <Balance<T>>::insert((collection.id, from), balance_from);261 }266 }pallets/nonfungible/src/lib.rsdiffbeforeafterboth340 .checked_sub(1)340 .checked_sub(1)341 .ok_or(ArithmeticError::Overflow)?;341 .ok_or(ArithmeticError::Overflow)?;342343 // =========342344343 if balance == 0 {345 if balance == 0 {344 <AccountBalance<T>>::remove((collection.id, token_data.owner.clone()));346 <AccountBalance<T>>::remove((collection.id, token_data.owner.clone()));345 } else {347 } else {346 <AccountBalance<T>>::insert((collection.id, token_data.owner.clone()), balance);348 <AccountBalance<T>>::insert((collection.id, token_data.owner.clone()), balance);347 }349 }348350351 <PalletStructure<T>>::unnest_if_nested(349 if let Some(owner) = T::CrossTokenAddressMapping::address_to_token(&token_data.owner) {352 &token_data.owner,350 Self::unnest(owner, (collection.id, token));353 collection.id,351 }354 token352355 );353 // =========354356355 <Owned<T>>::remove((collection.id, &token_data.owner, token));357 <Owned<T>>::remove((collection.id, &token_data.owner, token));356 <TokensBurnt<T>>::insert(collection.id, burnt);358 <TokensBurnt<T>>::insert(collection.id, burnt);593595594 // =========596 // =========597598 <PalletStructure<T>>::unnest_if_nested(599 from,600 collection.id,601 token602 );595603596 <TokenData<T>>::insert(604 <TokenData<T>>::insert(597 (collection.id, token),605 (collection.id, token),pallets/refungible/src/lib.rsdiffbeforeafterboth395 // from != to395 // from != to396 if balance_from == 0 {396 if balance_from == 0 {397 <Balance<T>>::remove((collection.id, token, from));397 <Balance<T>>::remove((collection.id, token, from));398 <PalletStructure<T>>::unnest_if_nested(399 from,400 collection.id,401 token402 );398 } else {403 } else {399 <Balance<T>>::insert((collection.id, token, from), balance_from);404 <Balance<T>>::insert((collection.id, token, from), balance_from);400 }405 }