dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.19k forks source link

feat: support descriptor wallets for RPC governance votemany, votealias #6094

Open knst opened 4 days ago

knst commented 4 days ago

Issue being fixed or feature implemented

RPCs governance votemany and governance votealias use forcely LegacyScriptPubKeyMan instead using CWallet's interface. It causes a failures such as

test_framework.authproxy.JSONRPCException: This type of wallet does not support this command (-4)

See https://github.com/dashpay/dash-issues/issues/59 to track progress

What was done?

Use CWallet's interfaces instead LegacyScriptPubKeyMan

How Has This Been Tested?

Functional tests feature_governance.py and feature_governance_cl.py to run by both ways - legacy and descriptor wallets.

Run unit and functional tests.

Extra test done locally:

--- a/test/functional/test_framework/test_framework.py
+++ b/test/functional/test_framework/test_framework.py
@@ -242,10 +242,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):

         if self.options.descriptors is None:
             # Prefer BDB unless it isn't available
-            if self.is_bdb_compiled():
-                self.options.descriptors = False
-            elif self.is_sqlite_compiled():
+            if self.is_sqlite_compiled():
                 self.options.descriptors = True
+            elif self.is_bdb_compiled():
+                self.options.descriptors = False

to flip flag descriptor wallets/legacy wallets for all functional tests.

Breaking Changes

N/A

Checklist:

PastaPastaPasta commented 2 days ago

Any reason this should be in v21 instead of 21.1?