dev
dart 31 lines 1.08 KB
Raw
1 import "package:cake_wallet/core/lightning_invoice_service.dart";
2 import "package:cw_core/lnurl.dart";
3 import "package:cw_core/utils/proxy_wrapper.dart";
4 import "package:cw_core/utils/tor/abstract.dart";
5 import "package:flutter_test/flutter_test.dart";
6
7 Future<void> main() async {
8 CakeTor.instance = await CakeTorInstance.getInstance();
9
10 group("lightning_invoice_service", () {
11 test("Should resolve an empty Bolt11 invoice konsti@cake.cash", () async {
12 final invoice = await getBolt11FromLightingAddress("konsti@cake.cash");
13
14 expect(invoice, isNotNull);
15 expect(isBolt11ZeroInvoice(invoice!), isTrue);
16 });
17
18 test("Should not resolve an empty Bolt11 invoice viksharma@cluborange.org", () async {
19 final invoice = await getBolt11FromLightingAddress("viksharma@cluborange.org");
20
21 expect(invoice, isNull);
22 });
23
24 test("Should resolve an Bolt11 invoice viksharma@cluborange.org", () async {
25 final invoice =
26 await getBolt11FromLightingAddress("viksharma@cluborange.org", amount: 1000000000);
27
28 expect(invoice, isNotNull);
29 });
30 });
31 }