mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
* v6.0.2 Release candidate * v6.0.2 Release candidate * move btc ln up in the currency picker * disable bsc for swapsxyz * minor [skip ci] * hide dex/rate selection on swap screen * temp fix for evm tokens swaps icons until hive migration is done * minor [skip ci] * disable force dex providers for existing users and let them pick it from settings preference * Show bitcoin address types in swap picker (#3096) * Show bitcoin address types in swap picker * remove wrong conversion to bolt11 [skip ci] * feat: add Lightning invoice resolution and address normalization * automatically select contact wallet address based on the selected swap currency (whether it's bitcoin or lightning) * minor [skip ci] * default to bolt11 invoice for lightning swaps --------- Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com> --------- Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
32 lines
1.1 KiB
Dart
32 lines
1.1 KiB
Dart
import "package:cake_wallet/core/lightning_invoice_service.dart";
|
|
import "package:cw_core/lnurl.dart";
|
|
import "package:cw_core/utils/proxy_wrapper.dart";
|
|
import "package:cw_core/utils/tor/abstract.dart";
|
|
import "package:flutter_test/flutter_test.dart";
|
|
|
|
Future<void> main() async {
|
|
CakeTor.instance = await CakeTorInstance.getInstance();
|
|
|
|
group("lightning_invoice_service", () {
|
|
test("Should resolve an empty Bolt11 invoice konsti@cake.cash", () async {
|
|
final invoice = await getBolt11FromLightingAddress("konsti@cake.cash");
|
|
|
|
expect(invoice, isNotNull);
|
|
expect(isBolt11ZeroInvoice(invoice!), isTrue);
|
|
});
|
|
|
|
test("Should not resolve an empty Bolt11 invoice viksharma@cluborange.org", () async {
|
|
final invoice = await getBolt11FromLightingAddress("viksharma@cluborange.org");
|
|
|
|
expect(invoice, isNull);
|
|
});
|
|
|
|
test("Should resolve an Bolt11 invoice viksharma@cluborange.org", () async {
|
|
final invoice =
|
|
await getBolt11FromLightingAddress("viksharma@cluborange.org", amount: 1000000000);
|
|
|
|
expect(invoice, isNotNull);
|
|
});
|
|
});
|
|
}
|