mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-02 13:03:00 +02:00
rpc: deprecate "warning" field in {create,load,unload,restore}wallet
This string field has been replaced in these four RPCs by a "warnings" field returning a JSON array of strings.
This commit is contained in:
@@ -265,7 +265,12 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
||||
)
|
||||
load_res = node_master.loadwallet("u1_v16")
|
||||
# Make sure this wallet opens without warnings. See https://github.com/bitcoin/bitcoin/pull/19054
|
||||
assert_equal(load_res['warning'], '')
|
||||
if int(node_master.getnetworkinfo()["version"]) >= 249900:
|
||||
# loadwallet#warnings (added in v25) -- only present if there is a warning
|
||||
assert "warnings" not in load_res
|
||||
else:
|
||||
# loadwallet#warning (deprecated in v25) -- always present, but empty string if no warning
|
||||
assert_equal(load_res["warning"], '')
|
||||
wallet = node_master.get_wallet_rpc("u1_v16")
|
||||
info = wallet.getaddressinfo(v16_addr)
|
||||
descriptor = f"wpkh([{info['hdmasterfingerprint']}{hdkeypath[1:]}]{v16_pubkey})"
|
||||
|
@@ -25,6 +25,7 @@ class CreateWalletTest(BitcoinTestFramework):
|
||||
|
||||
def set_test_params(self):
|
||||
self.num_nodes = 1
|
||||
self.extra_args = [["-deprecatedrpc=walletwarningfield"]]
|
||||
|
||||
def skip_test_if_missing_module(self):
|
||||
self.skip_if_no_wallet()
|
||||
|
Reference in New Issue
Block a user