diff options
author | Andrew Chow <achow101-github@achow101.com> | 2022-02-11 12:20:13 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2022-02-11 12:20:22 -0500 |
commit | 2d7ea201fc17ebf2cc65778e4adaa71a4e221fe3 (patch) | |
tree | 0bb43aff7dcc60ac07c7e30f92473364cdfeff24 | |
parent | b79c40b057ec39045d0036d978b3c01a5cf9f712 (diff) | |
parent | b75f4c89ec4d33a3014ccd5151964881b5e0aa1c (diff) | |
download | bitcoin-2d7ea201fc17ebf2cc65778e4adaa71a4e221fe3.tar.xz |
Merge bitcoin/bitcoin#24307: RPC: Return external_signer in getwalletinfo
b75f4c89ec4d33a3014ccd5151964881b5e0aa1c RPC: Return external_signer in getwalletinfo (Kristaps Kaupe)
Pull request description:
Add `external_signer` to the result object of `getwalletinfo` RPC which indicates whether `WALLET_FLAG_EXTERNAL_SIGNER` flag is set for the wallet.
ACKs for top commit:
S3RK:
utACK b75f4c89ec4d33a3014ccd5151964881b5e0aa1c
achow101:
ACK b75f4c89ec4d33a3014ccd5151964881b5e0aa1c
prayank23:
utACK https://github.com/bitcoin/bitcoin/pull/24307/commits/b75f4c89ec4d33a3014ccd5151964881b5e0aa1c
brunoerg:
utACK b75f4c89ec4d33a3014ccd5151964881b5e0aa1c
Tree-SHA512: 066ccb97541fd4dc3d9728834645db714a3c8c93ccf29142811af4d79cfb9440a97bbb6c845434a909bc6e1775ef3737fcbb368c1f0582bc63973f6deb17a45f
-rw-r--r-- | src/wallet/rpc/wallet.cpp | 2 | ||||
-rwxr-xr-x | test/functional/wallet_signer.py | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp index 33ec715b51..883a3c102b 100644 --- a/src/wallet/rpc/wallet.cpp +++ b/src/wallet/rpc/wallet.cpp @@ -57,6 +57,7 @@ static RPCHelpMan getwalletinfo() {RPCResult::Type::NUM, "progress", "scanning progress percentage [0.0, 1.0]"}, }}, {RPCResult::Type::BOOL, "descriptors", "whether this wallet uses descriptors for scriptPubKey management"}, + {RPCResult::Type::BOOL, "external_signer", "whether this wallet is configured to use an external signer such as a hardware wallet"}, }}, }, RPCExamples{ @@ -117,6 +118,7 @@ static RPCHelpMan getwalletinfo() obj.pushKV("scanning", false); } obj.pushKV("descriptors", pwallet->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)); + obj.pushKV("external_signer", pwallet->IsWalletFlagSet(WALLET_FLAG_EXTERNAL_SIGNER)); return obj; }, }; diff --git a/test/functional/wallet_signer.py b/test/functional/wallet_signer.py index 9e2db517b6..423cfecdc0 100755 --- a/test/functional/wallet_signer.py +++ b/test/functional/wallet_signer.py @@ -72,10 +72,12 @@ class WalletSignerTest(BitcoinTestFramework): self.nodes[1].createwallet(wallet_name='hww', disable_private_keys=True, descriptors=True, external_signer=True) hww = self.nodes[1].get_wallet_rpc('hww') + assert_equal(hww.getwalletinfo()["external_signer"], True) # Flag can't be set afterwards (could be added later for non-blank descriptor based watch-only wallets) self.nodes[1].createwallet(wallet_name='not_hww', disable_private_keys=True, descriptors=True, external_signer=False) not_hww = self.nodes[1].get_wallet_rpc('not_hww') + assert_equal(not_hww.getwalletinfo()["external_signer"], False) assert_raises_rpc_error(-8, "Wallet flag is immutable: external_signer", not_hww.setwalletflag, "external_signer", True) # assert_raises_rpc_error(-4, "Multiple signers found, please specify which to use", wallet_name='not_hww', disable_private_keys=True, descriptors=True, external_signer=True) |