ivy-wallet icon indicating copy to clipboard operation
ivy-wallet copied to clipboard

[BUG] Incorrect addition on account transfer

Open pravissw opened this issue 1 year ago • 1 comments

Please confirm the following

Describe the bug

One of my accounts had a balance of 32.45€. I transferred 167.55€ from another account to make it 200€. Adding this on ivy wallet somehow results in ivy showing a balance of 199€ in the first account.

I modified the amount of the account transfer on ivy wallet to observe some funny results, pfa some screenshots. The same error is also there if I change the amount to 67,55 (the total should be 100€ but it shows 99€)

To Reproduce

Add an account transfer to make the balance a multiple of 100

Expected behavior

The new balance should be exact

Screenshots

Screenshot_2024-02-02-10-23-50-84_5e9f1c73c4ea0ad7b9937a61f977427e Screenshot_2024-02-02-10-23-40-33_5e9f1c73c4ea0ad7b9937a61f977427e Screenshot_2024-02-02-10-16-43-13_5e9f1c73c4ea0ad7b9937a61f977427e Screenshot_2024-02-02-10-16-28-93_5e9f1c73c4ea0ad7b9937a61f977427e Screenshot_2024-02-02-10-16-14-58_5e9f1c73c4ea0ad7b9937a61f977427e Screenshot_2024-02-02-10-16-07-47_5e9f1c73c4ea0ad7b9937a61f977427e

Smartphone

OnePlus Nord CE 2

Additional context

No response

pravissw avatar Feb 02 '24 09:02 pravissw

Thank you @pravissw for raising Issue #2910! 🚀 What's next? Read our Contribution Guidelines 📚.

Tagging @ILIYANGERMANOV for review & approval 👀

ivywallet avatar Feb 02 '24 09:02 ivywallet

Hey @ILIYANGERMANOV I would like to work on this but this would result in re-write of calculation methods As we have a lot of deprecated methods / Act for it

Acceptable for re-work?

Vishwa-Raghavendra avatar Mar 09 '24 11:03 Vishwa-Raghavendra

Hey @ILIYANGERMANOV I would like to work on this but this would result in re-write of calculation methods As we have a lot of deprecated methods / Act for it

Acceptable for re-work?

Hey @Vishwa-Raghavendra, ideally, we should rewrite them in :shared:domain as use-cases + unit tests and having the new domain model.

You can also fix the old ones if you wish but at one point they'll be thrown away

ILIYANGERMANOV avatar Mar 09 '24 11:03 ILIYANGERMANOV

Hey @ILIYANGERMANOV I would like to work on this but this would result in re-write of calculation methods As we have a lot of deprecated methods / Act for it Acceptable for re-work?

Hey @Vishwa-Raghavendra, ideally, we should rewrite them in :shared:domain as use-cases + unit tests and having the new domain model.

You can also fix the old ones if you wish but at one point they'll be thrown away

Yes I was thinking the same, re-write in shared:Domain as use cases with some tests

Can't fix the old ones now, Too many modifications will result in unstable code

Vishwa-Raghavendra avatar Mar 09 '24 12:03 Vishwa-Raghavendra

@Vishwa-Raghavendra that's perfect! The old ones are garbage, just make sure that the new are:

  • type-safe
  • do not throw exceptions, use Either
  • make them type-safe
  • simple
  • main-safe (computations happen on a background thread)

Also check #2990

ILIYANGERMANOV avatar Mar 09 '24 14:03 ILIYANGERMANOV

Sure @ILIYANGERMANOV

Vishwa-Raghavendra avatar Mar 23 '24 03:03 Vishwa-Raghavendra

I'm on it

Vishwa-Raghavendra avatar Mar 23 '24 03:03 Vishwa-Raghavendra

Thank you for your interest @Vishwa-Raghavendra! 🎉 Issue #2910 is assigned to you. You can work on it! ✅

If you don't want to work on it now, please un-assign yourself so other contributors can take it.

Also, make sure to read our Contribution Guidelines.

ivywallet avatar Mar 23 '24 03:03 ivywallet

Hey @Vishwa-Raghavendra did you find anything about this one? I'm considering if we can release the current GitHub version to Beta

ILIYANGERMANOV avatar Apr 01 '24 20:04 ILIYANGERMANOV