mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 06:52:36 +01:00
Merge bitcoin/bitcoin#26730: test: add coverage for purpose
arg in listlabels
c467cfffce
test: add coverage for `purpose` arg in `listlabels` (brunoerg) Pull request description: This PR adds test coverage for `listlabels` command when specifying the `purpose` (send and receive).dcdfd72861/src/wallet/rpc/addresses.cpp (L698-L704)
ACKs for top commit: kristapsk: ACKc467cfffce
Tree-SHA512: 7e7143c1264692f7b22952e7c70dbe9ed3f5dcd2e3b69962a47be9f9c21b3f4a9089ca87962fbc8ff9116e7d2dbeb7f36d6a132c9ac13724a255cfe1b32373a8
This commit is contained in:
commit
b168b71a5d
1 changed files with 8 additions and 2 deletions
|
@ -23,7 +23,7 @@ class WalletLabelsTest(BitcoinTestFramework):
|
|||
|
||||
def set_test_params(self):
|
||||
self.setup_clean_chain = True
|
||||
self.num_nodes = 1
|
||||
self.num_nodes = 2
|
||||
|
||||
def skip_test_if_missing_module(self):
|
||||
self.skip_if_no_wallet()
|
||||
|
@ -121,8 +121,14 @@ class WalletLabelsTest(BitcoinTestFramework):
|
|||
label.add_receive_address(address)
|
||||
label.verify(node)
|
||||
|
||||
# Check listlabels when passing 'purpose'
|
||||
node2_addr = self.nodes[1].getnewaddress()
|
||||
node.setlabel(node2_addr, "node2_addr")
|
||||
assert_equal(node.listlabels(purpose="send"), ["node2_addr"])
|
||||
assert_equal(node.listlabels(purpose="receive"), sorted(['coinbase'] + [label.name for label in labels]))
|
||||
|
||||
# Check all labels are returned by listlabels.
|
||||
assert_equal(node.listlabels(), sorted(['coinbase'] + [label.name for label in labels]))
|
||||
assert_equal(node.listlabels(), sorted(['coinbase'] + [label.name for label in labels] + ["node2_addr"]))
|
||||
|
||||
# Send a transaction to each label.
|
||||
for label in labels:
|
||||
|
|
Loading…
Add table
Reference in a new issue