mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 2d7ea201fc into merged_master (Bitcoin PR bitcoin/bitcoin#24307)
This commit is contained in:
commit
db3167a06b
2 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -73,10 +73,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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue