refactor: rewrite shannonToCKBFormatter with formatUnit - #3129
Conversation
|
Only one line was changed compared to the last PR at #3128 - signDisplay: showPositiveSign ? 'always' : 'auto',
+ signDisplay: showPositiveSign && +shannon > 0 ? 'always' : 'auto',Since it's a small change, you don't need to close and reopen a new one. You can commit the change after commenting on it. GitHub will mark the previous comment as outdated if you modify the code |
Problem Description
See it in previous comment. Can the code in this PR run properly ?YES. Why the Unit Tests workflow failed ?Unit Tests workflow is run in Node.js 18.12.0 (V8 10.2). How to fix it ?Solution 1
Solution 2
Support✅
Discussion@Keith-CY @homura @yanguoyu @devchenyan Please leave comments about your ideas or solutions, or pick one solution from above. Thanks! |
|
The UDT amount data structure is a u128 while the capacity is a u64. For the shannonToCkb function, the number should not exceed 18446744073709551615. I believe this is an overthink. |
|
I guess we will update Electron finally, so it's maybe a solution. |
It should work when Say the amount to send is set very large, much over the reasonable value, a message I would suggest fixing this issue by upgrading Electron because it's introduced by the previous release of Electron. |
|
This PR has been reviewed before, and all checks have passed after we upgrade Unit Tests Node.js version to 20.11.1 |

delimiter: string = ','has been replaced byshowCommaSeparator = trueto make things simpler.showPositiveSign = truetakes effect ONLY when shannon value is > 0 . @Keith-CY