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):
49
49
self .test_desc ()
50
50
self .test_send_to_self ()
51
51
self .test_op_return ()
52
+ self .test_label ()
52
53
53
54
def test_no_blockhash (self ):
54
55
self .log .info ("Test no blockhash" )
@@ -465,6 +466,20 @@ def test_op_return(self):
465
466
466
467
assert 'address' not in op_ret_tx
467
468
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
+
468
483
469
484
if __name__ == '__main__' :
470
485
ListSinceBlockTest ().main ()
You can’t perform that action at this time.
0 commit comments