diff options
author | brunoerg <brunoely.gc@gmail.com> | 2022-08-24 16:40:26 -0300 |
---|---|---|
committer | brunoerg <brunoely.gc@gmail.com> | 2022-12-06 15:27:50 -0300 |
commit | fe488b4c4b7aa07fb83d528e2942ef914fd188c0 (patch) | |
tree | c0360f6888cf7c7f41c49658f1d48de5dc9a2bab | |
parent | 722e9a418d078ed34aedd1ca55c1ae104f29a7d3 (diff) |
test: add coverage for `label` in `listsinceblock`
-rwxr-xr-x | test/functional/wallet_listsinceblock.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/wallet_listsinceblock.py b/test/functional/wallet_listsinceblock.py index ecdfb7d0e3..62e9c5ba97 100755 --- a/test/functional/wallet_listsinceblock.py +++ b/test/functional/wallet_listsinceblock.py @@ -49,6 +49,7 @@ class ListSinceBlockTest(BitcoinTestFramework): self.test_desc() self.test_send_to_self() self.test_op_return() + self.test_label() def test_no_blockhash(self): self.log.info("Test no blockhash") @@ -465,6 +466,20 @@ class ListSinceBlockTest(BitcoinTestFramework): assert 'address' not in op_ret_tx + def test_label(self): + self.log.info('Test passing "label" argument fetches incoming transactions having the specified label') + new_addr = self.nodes[1].getnewaddress(label="new_addr", address_type="bech32") + + self.nodes[2].sendtoaddress(address=new_addr, amount="0.001") + self.generate(self.nodes[2], 1) + + for label in ["new_addr", ""]: + new_addr_transactions = self.nodes[1].listsinceblock(label=label)["transactions"] + assert_equal(len(new_addr_transactions), 1) + assert_equal(new_addr_transactions[0]["label"], label) + if label == "new_addr": + assert_equal(new_addr_transactions[0]["address"], new_addr) + if __name__ == '__main__': ListSinceBlockTest().main() |