@@ -112,7 +112,6 @@ def get_esplora_endpoint():
112112 return str (os .environ ['ESPLORA_ENDPOINT' ])
113113 return DEFAULT_ESPLORA_SERVER_URL
114114
115- # handling expected event
116115
117116def expect_event (node , expected_event_type ):
118117 event = node .wait_next_event ()
@@ -121,9 +120,6 @@ def expect_event(node, expected_event_type):
121120 node .event_handled ()
122121 return event
123122
124- def expect_channel_pending_event (node ):
125- event = expect_event (node , Event .CHANNEL_PENDING )
126- return event .funding_txo .txid
127123
128124
129125class TestLdkNode (unittest .TestCase ):
@@ -189,21 +185,21 @@ def test_channel_full_cycle(self):
189185
190186 node_1 .open_channel (node_id_2 , listening_addresses_2 [0 ], 50000 , None , None )
191187
192- funding_txid = expect_channel_pending_event (node_1 )
188+ funding_txid = (node_1 )
193189
194- expect_event (node_2 , Event .CHANNEL_PENDING )
190+ channel_pending_event_1 = expect_event (node_2 , Event .CHANNEL_PENDING )
195191
196192 wait_for_tx (esplora_endpoint , funding_txid )
197193 mine_and_wait (esplora_endpoint , 6 )
198194
199195 node_1 .sync_wallets ()
200196 node_2 .sync_wallets ()
201197
202- # expect generic channel ready event on node 1
198+ funding_txid = channel_pending_event_1 . funding_txo . txid
203199 channel_ready_event_1 = expect_event (node_1 , Event .CHANNEL_READY )
204200 print ("funding_txo:" , funding_txid )
205201
206- channel_ready_event_2 = expect_channel_ready_event (node_2 )
202+ channel_ready_event_2 = expect_event (node_2 , Event . CHANNEL_READY )
207203
208204 description = Bolt11InvoiceDescription .DIRECT ("asdf" )
209205 invoice = node_2 .bolt11_payment ().receive (2500000 , description , 9217 )
0 commit comments