From cebae5a445567f045517c495691243cd8bebf943 Mon Sep 17 00:00:00 2001 From: pasta Date: Wed, 19 Aug 2026 05:26:36 -0500 Subject: [PATCH 1/2] feat(qt): add masternode registration and maintenance UI --- src/Makefile.qt.include | 12 + src/Makefile.qttest.include | 6 + src/interfaces/providertx.h | 2 + src/qt/forms/masternodelist.ui | 10 + src/qt/masternodedialogs.cpp | 721 ++++++++ src/qt/masternodedialogs.h | 222 +++ src/qt/masternodelist.cpp | 100 +- src/qt/masternodelist.h | 9 + src/qt/masternodemodel.cpp | 54 +- src/qt/masternodemodel.h | 25 +- src/qt/masternodeoperationrunner.cpp | 165 ++ src/qt/masternodeoperationrunner.h | 70 + src/qt/masternodewidgets.cpp | 347 ++++ src/qt/masternodewidgets.h | 158 ++ src/qt/masternodewizard.cpp | 1788 ++++++++++++++++++++ src/qt/masternodewizard.h | 235 +++ src/qt/res/css/dark.css | 8 +- src/qt/res/css/general.css | 11 +- src/qt/res/css/light.css | 8 +- src/qt/res/css/traditional.css | 13 +- src/qt/test/masternodemaintenancetests.cpp | 529 ++++++ src/qt/test/masternodemaintenancetests.h | 40 + src/qt/test/masternodewidgettests.cpp | 1055 ++++++++++++ src/qt/test/masternodewidgettests.h | 46 + src/qt/test/test_main.cpp | 8 + test/util/data/non-backported.txt | 6 + 26 files changed, 5627 insertions(+), 21 deletions(-) create mode 100644 src/qt/masternodedialogs.cpp create mode 100644 src/qt/masternodedialogs.h create mode 100644 src/qt/masternodeoperationrunner.cpp create mode 100644 src/qt/masternodeoperationrunner.h create mode 100644 src/qt/masternodewidgets.cpp create mode 100644 src/qt/masternodewidgets.h create mode 100644 src/qt/masternodewizard.cpp create mode 100644 src/qt/masternodewizard.h create mode 100644 src/qt/test/masternodemaintenancetests.cpp create mode 100644 src/qt/test/masternodemaintenancetests.h create mode 100644 src/qt/test/masternodewidgettests.cpp create mode 100644 src/qt/test/masternodewidgettests.h diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 16296207eca1..56ddd8a12156 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -71,8 +71,12 @@ QT_MOC_CPP = \ qt/moc_intro.cpp \ qt/moc_macdockiconhandler.cpp \ qt/moc_macnotificationhandler.cpp \ + qt/moc_masternodedialogs.cpp \ qt/moc_masternodelist.cpp \ qt/moc_masternodemodel.cpp \ + qt/moc_masternodeoperationrunner.cpp \ + qt/moc_masternodewidgets.cpp \ + qt/moc_masternodewizard.cpp \ qt/moc_mnemonicverificationdialog.cpp \ qt/moc_modaloverlay.cpp \ qt/moc_networkwidget.cpp \ @@ -158,8 +162,12 @@ BITCOIN_QT_H = \ qt/macdockiconhandler.h \ qt/macnotificationhandler.h \ qt/macos_appnap.h \ + qt/masternodedialogs.h \ qt/masternodelist.h \ qt/masternodemodel.h \ + qt/masternodeoperationrunner.h \ + qt/masternodewidgets.h \ + qt/masternodewizard.h \ qt/mnemonicverificationdialog.h \ qt/modaloverlay.h \ qt/networkstyle.h \ @@ -302,7 +310,11 @@ BITCOIN_QT_WALLET_CPP = \ qt/createwalletdialog.cpp \ qt/descriptiondialog.cpp \ qt/editaddressdialog.cpp \ + qt/masternodedialogs.cpp \ qt/masternodelist.cpp \ + qt/masternodeoperationrunner.cpp \ + qt/masternodewidgets.cpp \ + qt/masternodewizard.cpp \ qt/mnemonicverificationdialog.cpp \ qt/openuridialog.cpp \ qt/overviewpage.cpp \ diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index bcea59d339d8..00401c6340d7 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -17,12 +17,16 @@ if ENABLE_WALLET TEST_QT_MOC_CPP += \ qt/test/moc_addressbooktests.cpp \ qt/test/moc_providertransactiontests.cpp \ + qt/test/moc_masternodewidgettests.cpp \ + qt/test/moc_masternodemaintenancetests.cpp \ qt/test/moc_wallettests.cpp endif # ENABLE_WALLET TEST_QT_H = \ qt/test/addressbooktests.h \ qt/test/apptests.h \ + qt/test/masternodemaintenancetests.h \ + qt/test/masternodewidgettests.h \ qt/test/optiontests.h \ qt/test/providertransactiontests.h \ qt/test/rpcnestedtests.h \ @@ -48,6 +52,8 @@ if ENABLE_WALLET qt_test_test_dash_qt_SOURCES += \ qt/test/addressbooktests.cpp \ qt/test/providertransactiontests.cpp \ + qt/test/masternodewidgettests.cpp \ + qt/test/masternodemaintenancetests.cpp \ qt/test/wallettests.cpp \ wallet/test/wallet_test_fixture.cpp endif # ENABLE_WALLET diff --git a/src/interfaces/providertx.h b/src/interfaces/providertx.h index c9f048efe31d..0561d84a095a 100644 --- a/src/interfaces/providertx.h +++ b/src/interfaces/providertx.h @@ -75,6 +75,8 @@ struct ProviderNetInfo { }; struct ProviderPayout { + static constexpr uint16_t MAX_REWARD{10000}; + CTxDestination destination; uint16_t reward{0}; }; diff --git a/src/qt/forms/masternodelist.ui b/src/qt/forms/masternodelist.ui index 41d519b2095a..ab3c7cdd7b59 100644 --- a/src/qt/forms/masternodelist.ui +++ b/src/qt/forms/masternodelist.ui @@ -93,6 +93,16 @@ + + + + Register a new masternode or evonode using this wallet + + + Register Masternode… + + + diff --git a/src/qt/masternodedialogs.cpp b/src/qt/masternodedialogs.cpp new file mode 100644 index 000000000000..214b23cc6d4a --- /dev/null +++ b/src/qt/masternodedialogs.cpp @@ -0,0 +1,721 @@ +// Copyright (c) 2026 The Dash Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include + +#include +#include +#include +#include +#include +#include +#include +#include