Skip to content

Conversation

@daharkan
Copy link

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.

@PastaPastaPasta
Copy link
Member

Payments remaining calculation is wrong. (Also should probably have tests associated with it.)

image

@github-actions
Copy link

This Pull Request may conflict if the Pull Requests below are merged first.

#4649
conflictable files: src/qt/governancelist.cpp,src/qt/governancelist.h

proposaltests added for testing paymentRemaining calculation
@@ -0,0 +1,21 @@
#include "proposaltests.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need add copyright

@@ -0,0 +1,15 @@
#ifndef PROPOSALTESTS_H
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyright

Comment on lines +10 to +20
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Author

@daharkan daharkan Jan 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ptr should go on the type

Suggested change
QAction *openProposalUrl = qobject_cast<QAction*>(sender());
QAction* openProposalUrl = qobject_cast<QAction*>(sender());

@PastaPastaPasta
Copy link
Member

return proposal->GetNoCount();
case Column::ABSOLUTE_YES:
return proposal->GetAbsoluteYesCount();
case Column::ABSTEIN_COUNT:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ABSTAIN

return proposal->GetNoCount();
case Column::ABSOLUTE_YES:
return proposal->GetAbsoluteYesCount();
case Column::ABSTEIN_COUNT:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ABSTAIN

return Qt::AlignCenter;
case Column::ABSOLUTE_YES:
return Qt::AlignCenter;
case Column::ABSTEIN_COUNT:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ABSTAIN

Comment on lines +258 to +259
case Column::ABSTEIN_COUNT:
return "Abstein";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ABSTAIN and return "Abstain"

return 180;
case Column::YES_COUNT:
case Column::NO_COUNT:
case Column::ABSTEIN_COUNT:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ABSTAIN

IS_ACTIVE,
YES_COUNT,
NO_COUNT,
ABSTEIN_COUNT,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ABSTAIN

@github-actions
Copy link

This pull request has conflicts, please rebase.

@DashCoreAutoGuix
Copy link

❌ Backport Verification - CATASTROPHIC FAILURE

Original Bitcoin commit: 97ee866549
Reviewed commit hash: 733b2b9bfb-verify-$(date +%s)

Critical violations detected:

1. Complete Backport Mismatch 🚨

  • Bitcoin PR#4351: Implements REST UTXOS functionality (getutxos REST command)
  • This Dash PR: Implements governance UI improvements (completely unrelated)
  • Verdict: Wrong functionality entirely - this is not a backport at all

2. Size Explosion (Inverse) 🚨

  • Bitcoin changes: 433 lines across 4 files (REST implementation)
  • Dash changes: 5 lines in governance UI code
  • Size ratio: 0.0% - essentially no relevant backport content

3. File Operation Mismatch 🚨

  • Bitcoin modifies: qa/rpc-tests/rest.py, src/rest.cpp, src/rpcserver.cpp, src/rpcserver.h
  • Dash modifies: src/qt/governancelist.cpp, src/qt/test/proposaltests.cpp (completely different files)
  • Missing files: All 4 Bitcoin files are absent

4. Intent Violation 🚨

  • Bitcoin intent: Add UTXO querying via REST API with binary input/output (Bip64)
  • Dash implementation: Add UI tests and popup messages for governance proposals
  • Relationship: None - completely different features

Analysis Summary

This 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:

  • UTXO querying over REST (/rest/getutxos/ endpoint)
  • Binary input/output format as per Bip64
  • REST API tests in qa/rpc-tests/rest.py
  • Core REST functionality in src/rest.cpp

This PR instead implements:

  • Governance proposal UI enhancements
  • Test additions for proposal functionality
  • UI alignment and popup message improvements
❌ Comparison Analysis

Bitcoin commit 97ee866:

qa/rpc-tests/rest.py | 186 +++++++++++++++++++++++++++++++++++++--
src/rest.cpp         | 244 +++++++++++++++++++++++++++++++++++++++++++++++----
src/rpcserver.cpp    |   2 +-
src/rpcserver.h      |   1 +
4 files changed, 407 insertions(+), 26 deletions(-)

Dash PR #4629:

src/qt/test/proposaltests.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

No overlap in functionality, files, or intent.

Auto-Close Justification

This PR meets ALL catastrophic failure criteria:

  • Multiple Auto-Reject Conditions (4+ violations)
  • Fundamental Intent Violation (completely different functionality)
  • File Operation Mismatch (no overlapping files)
  • Size Mismatch (0.0% implementation of intended changes)

This PR has been automatically closed. Please create a new PR with the actual Bitcoin PR#4351 REST functionality backport.

@DashCoreAutoGuix
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants