git.delta.rocks / unique-network / refs/commits / a84ab599e8b4

difftreelog

fix use TokenValueTooLow

Daniel Shiposha2022-12-06parent: #1358a9b.patch.diff
in: master

1 file changed

modifiedpallets/refungible/src/lib.rsdiffbeforeafterboth
453 amount: u128,453 amount: u128,
454 ) -> DispatchResult {454 ) -> DispatchResult {
455 if <Balance<T>>::get((collection.id, token, owner)) == 0 {455 if <Balance<T>>::get((collection.id, token, owner)) == 0 {
456 return Err(<CommonError<T>>::MustBeTokenOwner.into());456 return Err(<CommonError<T>>::TokenValueTooLow.into());
457 }457 }
458458
459 let total_supply = <TotalSupply<T>>::get((collection.id, token))459 let total_supply = <TotalSupply<T>>::get((collection.id, token))
745 let initial_balance_from = <Balance<T>>::get((collection.id, token, from));745 let initial_balance_from = <Balance<T>>::get((collection.id, token, from));
746746
747 if initial_balance_from == 0 {747 if initial_balance_from == 0 {
748 return Err(<CommonError<T>>::MustBeTokenOwner.into());748 return Err(<CommonError<T>>::TokenValueTooLow.into());
749 }749 }
750750
751 let updated_balance_from = initial_balance_from751 let updated_balance_from = initial_balance_from