hive-keychain / hive-keychain-extension

A wallet browser extension for the Hive blockchain and cryptocurrency
MIT License
77 stars 51 forks source link

[Bug] Hive Engine total token value adding total unstaking tokens in full+staked #487

Closed forkyishere closed 3 months ago

forkyishere commented 3 months ago

Just found that here:

https://github.com/hive-keychain/hive-keychain-extension/blob/ffdec1303716f6b8883b97ff6413b90590e905c7/src/popup/hive/utils/tokens.utils.ts#L311

The amount is negligible if very small so I never noticed, but when I unstaked all of the balance, I noticed this. Where it adds 75% more value in this case (for a 4-period unstaking token).

I think the best to do here, is to NOT sum the total pending unstaking, and instead calculate the total using the "period amount unstaking" (that is not visible on the staked amount anymore).

When periods advance, the total staked tokens will further reduce and add up with the already in liquid.

Pics (tested with version 3.1.4): image

image

CC @cedricguillas

stoodkev commented 3 months ago

Thanks for referencing the issue, it has been fixed and will be pushed in the live prod version