@@ -40,7 +40,7 @@ void main() {
4040 }
4141
4242 IntegrationTestWidgetsFlutterBinding .ensureInitialized ();
43- group ('bolt11_integration ' , () {
43+ group ('bolt12_integration ' , () {
4444 setUp (() async {});
4545 testWidgets ('full_cycle' , (WidgetTester tester) async {
4646 // Initialize flutter_rust_bridge
@@ -133,6 +133,7 @@ void main() {
133133 debugPrint ("Opening channel from aliceNode to bobNode" );
134134 final bobNodeId = await bobNode.nodeId ();
135135 debugPrint ("Bob's node ID: ${bobNodeId .toString ()}" );
136+ final bobNodeIdString = (await bobNode.nodeId ()).toString ();
136137
137138 // Check if nodes can see each other
138139 final bobListeningAddresses = await bobNode.listeningAddresses ();
@@ -179,7 +180,7 @@ void main() {
179180 final channels = await aliceNode.listChannels ();
180181 debugPrint ("Alice has ${channels .length } channels" );
181182
182- final bobChannels = channels.where ((e) => e.counterpartyNodeId.toString () == bobNodeId. toString () ).toList ();
183+ final bobChannels = channels.where ((e) => e.counterpartyNodeId.toString () == bobNodeIdString ).toList ();
183184
184185 if (bobChannels.isNotEmpty) {
185186 final channel = bobChannels.first;
@@ -228,14 +229,14 @@ void main() {
228229 }
229230
230231 expect (
231- (alicePeers.where ((e) => e.nodeId.toString () == bobNodeId. toString ())) .toList ().isNotEmpty,
232+ (alicePeers.where ((e) => e.nodeId.toString () == bobNodeIdString) .toList ().isNotEmpty) ,
232233 equals (true ));
233234
234235 // Generate more blocks to ensure channel is well-confirmed
235236 await regTestClient.generate (5 , await aliceNodeAddress.asString ());
236237 expect (
237238 (aliceChannels
238- .where ((e) => e.counterpartyNodeId.toString () == bobNodeId. toString () ))
239+ .where ((e) => e.counterpartyNodeId.toString () == bobNodeIdString ))
239240 .where ((f) => f.isUsable && f.isChannelReady)
240241 .toList () !=
241242 [],
@@ -276,22 +277,26 @@ void main() {
276277 debugPrint ("Offer2 created, now sending payment of ${payment2ExpectedAmountMsat }msat" );
277278 final payment2Id = await aliceNodeBol12Handler.sendUsingAmount (
278279 offer: offer2, amountMsat: BigInt .from (payment2ExpectedAmountMsat));
279- debugPrint ("payment_2 successful: ${payment2Id .toVec ().toString ()}" );
280-
280+ final payment2IdVec = await payment2Id.toVec ();
281+ debugPrint ("payment_2 successful: ${payment2IdVec .toString ()}" );
282+
281283 // Wait a moment for the payment to be recorded
282284 await Future .delayed (const Duration (milliseconds: 500 ));
283285
284286 // Debug: List all payments from Alice
285287 final allAlicePayments = await aliceNode.listPayments ();
286288 debugPrint ("Alice now has ${allAlicePayments .length } total payments:" );
287- for (int i = 0 ; i < allAlicePayments.length; i++ ) {
288- final payment = allAlicePayments[i];
289- debugPrint (" Payment $i : ID=${payment .id .toVec ()}, amount=${payment .amountMsat }msat, status=${payment .status }" );
290- }
289+ // for (int i = 0; i < allAlicePayments.length; i++) {
290+ // final payment = allAlicePayments[i];
291+ // debugPrint(" Payment $i:");
292+ // debugPrint(" ID: ${payment.id.toVec()}");
293+ // debugPrint(" Amount: ${payment.amountMsat}msat");
294+ // debugPrint(" Status: ${payment.status}");
295+ // }
291296
292297 // Check if payment2Id exists in the list
293- final matchingPayments = allAlicePayments. where ((e) => listEquals (e.id. toVec (), payment2Id. toVec ())). toList ( );
294- debugPrint ( "Looking for payment with ID: ${ payment2Id . toVec ()}" );
298+ debugPrint ( "Looking for payment with ID: ${ payment2IdVec }" );
299+ final matchingPayments = allAlicePayments. where ((e) => listEquals (e.id. toVec (), payment2IdVec)). toList ( );
295300 debugPrint ("Found ${matchingPayments .length } matching payments" );
296301
297302 if (matchingPayments.isEmpty) {
@@ -323,7 +328,7 @@ void main() {
323328 true );
324329 debugPrint ("Bob's payment 3 found successfully" );
325330 await aliceNode.closeChannel (
326- counterpartyNodeId: bobNodeId , userChannelId: userChannelId);
331+ counterpartyNodeId: await bobNode. nodeId () , userChannelId: userChannelId);
327332 debugPrint ("Closing channel between Alice and Bob" );
328333
329334 // Stop nodes with timeout to prevent hanging
0 commit comments