File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ def run_test(self):
4949 self .test_desc ()
5050 self .test_send_to_self ()
5151 self .test_op_return ()
52+ self .test_label ()
5253
5354 def test_no_blockhash (self ):
5455 self .log .info ("Test no blockhash" )
@@ -465,6 +466,20 @@ def test_op_return(self):
465466
466467 assert 'address' not in op_ret_tx
467468
469+ def test_label (self ):
470+ self .log .info ('Test passing "label" argument fetches incoming transactions having the specified label' )
471+ new_addr = self .nodes [1 ].getnewaddress (label = "new_addr" , address_type = "bech32" )
472+
473+ self .nodes [2 ].sendtoaddress (address = new_addr , amount = "0.001" )
474+ self .generate (self .nodes [2 ], 1 )
475+
476+ for label in ["new_addr" , "" ]:
477+ new_addr_transactions = self .nodes [1 ].listsinceblock (label = label )["transactions" ]
478+ assert_equal (len (new_addr_transactions ), 1 )
479+ assert_equal (new_addr_transactions [0 ]["label" ], label )
480+ if label == "new_addr" :
481+ assert_equal (new_addr_transactions [0 ]["address" ], new_addr )
482+
468483
469484if __name__ == '__main__' :
470485 ListSinceBlockTest ().main ()
You can’t perform that action at this time.
0 commit comments