Page MenuHomePhabricator

[electrum] fix integer overflow for the Proof total amount
ClosedPublic

Authored by PiRK on Nov 14 2023, 07:16.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCf3c21cd60f5b: [electrum] fix integer overflow for the Proof total amount
Summary

PyQt translates python integers to signed 32 bits int when emitting a int in a signal.
We need to specifically emit a 64 bit integer. See https://doc.qt.io/qt-5/qtglobal.html#quint64-typedef

Also apply the same fix to the two signals that I previously fixed in a different way (with a larger performance overhead) in https://github.com/Bitcoin-ABC/ElectrumABC/pull/291

Test Plan

load a proof with a total stake of more than 21,474,836.47 XEC, check the amount is displayed correctly.
Select coins and addresses of various amounts, check the selected amount displayed in the status bar.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
fix_int_overflow_stakes
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25609
Build 50799: Build Diffelectrum-tests
Build 50798: arc lint + arc unit

Event Timeline

PiRK requested review of this revision.Nov 14 2023, 07:16
PiRK planned changes to this revision.Nov 14 2023, 07:41

testing a better solution

PiRK edited the summary of this revision. (Show Details)
PiRK edited the test plan for this revision. (Show Details)

specifically emit a uint64. This is significantly less heavy than emitting a PyObject in the C++ call

remove the no longer relevant comment

This revision is now accepted and ready to land.Nov 14 2023, 08:05