mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-19 20:25:18 +01:00
rpc: simplify getaddressinfo labels, deprecate previous behavior
- change the value returned in the RPC getaddressinfo `labels` field to an array of label name strings - deprecate the previous behavior of returning a JSON hash structure containing label `name` and address `purpose` key/value pairs - update the relevant tests
This commit is contained in:
@@ -13,10 +13,8 @@ from collections import defaultdict
|
||||
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal, assert_raises_rpc_error
|
||||
from test_framework.wallet_util import (
|
||||
labels_value,
|
||||
test_address,
|
||||
)
|
||||
from test_framework.wallet_util import test_address
|
||||
|
||||
|
||||
class WalletLabelsTest(BitcoinTestFramework):
|
||||
def set_test_params(self):
|
||||
@@ -157,12 +155,7 @@ class Label:
|
||||
if self.receive_address is not None:
|
||||
assert self.receive_address in self.addresses
|
||||
for address in self.addresses:
|
||||
test_address(
|
||||
node,
|
||||
address,
|
||||
label=self.name,
|
||||
labels=labels_value(name=self.name, purpose=self.purpose[address])
|
||||
)
|
||||
test_address(node, address, label=self.name, labels=[self.name])
|
||||
assert self.name in node.listlabels()
|
||||
assert_equal(
|
||||
node.getaddressesbylabel(self.name),
|
||||
|
||||
Reference in New Issue
Block a user