File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
lib/wallets/crypto_currency/interfaces Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 11import 'package:coinlib_flutter/coinlib_flutter.dart' as cl;
2+ import 'package:flutter/foundation.dart' ;
23
34import '../../../models/isar/models/blockchain_data/address.dart' ;
5+ import '../../../utilities/logger.dart' ;
46import '../intermediate/bip39_hd_currency.dart' ;
57
68mixin ElectrumXCurrencyInterface on Bip39HDCurrency {
@@ -14,15 +16,29 @@ mixin ElectrumXCurrencyInterface on Bip39HDCurrency {
1416 try {
1517 final clAddress = cl.Address .fromString (address, networkParams);
1618
19+ Logging .instance.t (
20+ "getAddressType($address ) type is ${clAddress .runtimeType }" ,
21+ );
22+
1723 return switch (clAddress) {
1824 cl.P2PKHAddress () => AddressType .p2pkh,
19- cl.P2WSHAddress () => AddressType .p2sh,
25+ cl.P2SHAddress () => AddressType .p2sh,
2026 cl.P2WPKHAddress () => AddressType .p2wpkh,
2127 cl.P2TRAddress () => AddressType .p2tr,
2228 cl.MwebAddress () => AddressType .mweb,
2329 _ => null ,
2430 };
25- } catch (_) {
31+ } catch (e, s) {
32+ if (kDebugMode) {
33+ Logging .instance.e (
34+ "getAddressType($address ) failed" ,
35+ error: e,
36+ stackTrace: s,
37+ );
38+ } else {
39+ Logging .instance.t ("getAddressType($address ) failed" );
40+ }
41+
2642 return null ;
2743 }
2844 }
You can’t perform that action at this time.
0 commit comments