Closed jordanmack closed 2 years ago
Your analysis is correct. We found that for cells in the withdrawing state, get_balance is missing some calculations.
This problem is fixed by this https://github.com/nervosnetwork/mercury/pull/449, and we will arrange to release a new version as soon as possible.
Thanks a lot for your feedback.
Mercury v0.4.3 has been released and the public service has been updated.
The free balance being returned by Mercury does not seem to reflect all of the capacity available in this specific instance with a DAO cell in the withdrawal phase that is mature.
Balances from Mercury are:
To calculate the free amount of 1664, Mercury includes the 98 CKB from the DAO cell in the withdrawal phase but excludes the 102 CKB occupied capacity by that cell.
200 - 102 + 1227 + 139 + 200 = 1664
Mercury is generating transactions using the DAO cell in the withdrawal phase since it is mature. The 102 CKB required on the cell should not be subtracted in this case because this cell can be spent the same as a basic cell.
200 + 1227 + 139 + 200 = 1766
This amount of 1766 is relevant to developers because they need a way to represent what balance is available for the user to send using Mercury to generate transactions.
Raw requests are below: