dashpay / dash

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

feat: support rpc protx-register for descriptor wallets - part VI #6003

Closed knst closed 3 months ago

knst commented 4 months ago

Issue being fixed or feature implemented

Many rpc such as protx register uses 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)

for all functional tests that uses Masternodes/evo nodes.

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

What was done?

Some direct usages of LegacyScriptPubKeyMan refactored to use CWallet's functionality. There are still 4 functional tests that doesn't work for descriptor wallets:

That's part I of changes, other changes are not PR-ready yet, WIP.

How Has This Been Tested?

Firstly, the flag --legacy-wallets are removed for many functional tests. Secondly, the flag --descriptors is inverted in default value:

diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
index 585a6a74d6..9ad5fd1daa 100755
--- 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
             else:
                 # If neither are compiled, tests requiring a wallet will be skipped and the value of self.options.descriptors won't matter
                 # It still needs to exist and be None in order for tests to work however.

Breaking Changes

N/A, descriptor wallets have not been publicly released yet

Checklist:

github-actions[bot] commented 4 months ago

This pull request has conflicts, please rebase.