implemented changes suggested PR#4351#4629
Conversation
|
This Pull Request may conflict if the Pull Requests below are merged first. #4649 |
proposaltests added for testing paymentRemaining calculation
| @@ -0,0 +1,21 @@ | |||
| #include "proposaltests.h" | |||
| @@ -0,0 +1,15 @@ | |||
| #ifndef PROPOSALTESTS_H | |||
| proposal.m_currentDate = QDateTime(QDate(2022, 1, 2), QTime(12, 00)); | ||
| proposal.m_endDate = QDateTime(QDate(2022, 2, 9), QTime(12, 00)); | ||
| QVERIFY( proposal.paymentRemaining() == 1) ; | ||
|
|
||
| proposal.m_currentDate = QDateTime(QDate(2022, 1, 2), QTime(12, 00)); | ||
| proposal.m_endDate = QDateTime(QDate(2022, 3, 5), QTime(12, 00)); | ||
| QVERIFY( proposal.paymentRemaining() == 2); | ||
|
|
||
| proposal.m_currentDate = QDateTime(QDate(2022, 1, 2), QTime(12, 00)); | ||
| proposal.m_endDate = QDateTime(QDate(2022, 4, 10), QTime(12, 00)); | ||
| QVERIFY( proposal.paymentRemaining() == 3); |
There was a problem hiding this comment.
should test the exact edges, and preferably de-duplicate this code smth like
const auto& check_paymentRemaining = [&proposal](const auto& begin, const auto& end, int expected) {
proposal.m_currentDate = begin;
proposal.m_endDate = end;
QVERIFY( proposal.paymentRemaining() == expected) ;
}
Also, I think there may be a bug here... the currentDate and endDate shouldn't be enough to calculate payments remaining.. I think you also need to know when the last superblock was. @UdjinM6 maybe @thephez, what should the calculation be to determine payments remaining?
There was a problem hiding this comment.
Yes, it doesn't seem possible to fully evaluate without comparing against superblock times. I'm not sure what the full calculation would be, but it should be available somewhere in either Core or Sentinel. Perhaps @UdjinM6 has a reference? 🤞 DMT definitely does this calc also since it displays this info. My guess would be that it happens somewhere in here, but that's a long file.
Also, since the proposal start/end are defined as timestamps while the superblocks are based on block heights, it's not a precise calculation (i.e. it's impacted by variations in block time).
There was a problem hiding this comment.
Should it be something like this at line # 260 at here ?
payment_remaining = payment_cycles - cur_cycle
payment_cycles = int((end_sb - start_sb) / cycle_blocks) + 1
# calculate number of payment-months that passed already for the proposal
if start_sb > last_superblock:
cur_cycle = 0
else:
cur_cycle = int(((last_superblock - start_sb) / cycle_blocks)) + 1`
|
|
||
| void GovernanceList::openUrl() | ||
| { | ||
| QAction *openProposalUrl = qobject_cast<QAction*>(sender()); |
There was a problem hiding this comment.
ptr should go on the type
| QAction *openProposalUrl = qobject_cast<QAction*>(sender()); | |
| QAction* openProposalUrl = qobject_cast<QAction*>(sender()); |
| return proposal->GetNoCount(); | ||
| case Column::ABSOLUTE_YES: | ||
| return proposal->GetAbsoluteYesCount(); | ||
| case Column::ABSTEIN_COUNT: |
| return proposal->GetNoCount(); | ||
| case Column::ABSOLUTE_YES: | ||
| return proposal->GetAbsoluteYesCount(); | ||
| case Column::ABSTEIN_COUNT: |
| return Qt::AlignCenter; | ||
| case Column::ABSOLUTE_YES: | ||
| return Qt::AlignCenter; | ||
| case Column::ABSTEIN_COUNT: |
| case Column::ABSTEIN_COUNT: | ||
| return "Abstein"; |
There was a problem hiding this comment.
Should be ABSTAIN and return "Abstain"
| return 180; | ||
| case Column::YES_COUNT: | ||
| case Column::NO_COUNT: | ||
| case Column::ABSTEIN_COUNT: |
| IS_ACTIVE, | ||
| YES_COUNT, | ||
| NO_COUNT, | ||
| ABSTEIN_COUNT, |
|
This pull request has conflicts, please rebase. |
❌ Backport Verification - CATASTROPHIC FAILUREOriginal Bitcoin commit: Critical violations detected:1. Complete Backport Mismatch 🚨
2. Size Explosion (Inverse) 🚨
3. File Operation Mismatch 🚨
4. Intent Violation 🚨
Analysis SummaryThis PR appears to have been incorrectly titled and associated with Bitcoin PR#4351. The actual changes implement Dash-specific governance UI improvements that have no relationship to the Bitcoin REST functionality that should have been backported. Bitcoin PR#4351 should implement:
This PR instead implements:
❌ Comparison AnalysisBitcoin commit 97ee866: Dash PR #4629: No overlap in functionality, files, or intent. Auto-Close JustificationThis PR meets ALL catastrophic failure criteria:
This PR has been automatically closed. Please create a new PR with the actual Bitcoin PR#4351 REST functionality backport. |
|
Automatically closed due to catastrophic validation failures. This PR implements Dash governance UI changes instead of the intended Bitcoin REST functionality backport. Please see the detailed analysis above and create a new PR with the actual Bitcoin PR#4351 backport implementation (REST UTXOS functionality). |

Implemented #4351 (comment)
created new slot GovernanceList::openUrl(), not using Proposal::openUrl() since we need to show a pop-up message box and we need a QWidget parent.
Implemented TextAlignmentRole values for ProposalModel::data.