review fixes pt.1 [skip ci]

This commit is contained in:
Matthew Fosse 2024-06-14 09:44:15 -07:00
parent 6e0bb53abd
commit dd25b1a0f2
5 changed files with 10 additions and 30 deletions

View file

@ -114,7 +114,7 @@ class LightningWalletService extends WalletService<
@override
Future<LightningWallet> restoreFromSeed(BitcoinRestoreWalletFromSeedCredentials credentials,
{bool? isTestnet}) async {
if (!validateMnemonic(credentials.mnemonic)) {
if (!bip39.validateMnemonic(credentials.mnemonic)) {
throw BitcoinMnemonicIsIncorrectException();
}

View file

@ -1233,7 +1233,6 @@ Future<void> setup({
getIt.registerFactoryParam<LightningInvoicePage, void, void>((_, __) {
return LightningInvoicePage(
lightningInvoicePageViewModel: getIt.get<LightningInvoicePageViewModel>(),
lightningViewModel: getIt.get<LightningViewModel>(),
receiveOptionViewModel:
getIt.get<ReceiveOptionViewModel>(param1: lightning!.getOptionInvoice()),
);

View file

@ -279,7 +279,7 @@ class TrocadorExchangeProvider extends ExchangeProvider {
providerId: providerId,
providerName: providerName,
createdAt: DateTime.tryParse(date)?.toLocal(),
amount: responseJSON['amount_from']?.toString() ?? request.fromAmount,
amount: responseAmount,
payoutAddress: payoutAddress,
isSendAll: isSendAll);
}

View file

@ -47,6 +47,10 @@ Future<void> startFiatRateUpdate(
currencies =
solana!.getSPLTokenCurrencies(appStore.wallet!).where((element) => element.enabled);
break;
case WalletType.tron:
currencies =
tron!.getTronTokenCurrencies(appStore.wallet!).where((element) => element.enabled);
break;
case WalletType.lightning:
currencies = [CryptoCurrency.btc];
break;
@ -58,9 +62,10 @@ Future<void> startFiatRateUpdate(
for (final currency in currencies) {
() async {
fiatConversionStore.prices[currency] = await FiatConversionService.fetchPrice(
crypto: currency,
fiat: settingsStore.fiatCurrency,
torOnly: settingsStore.fiatApiMode == FiatApiMode.torOnly);
crypto: currency,
fiat: settingsStore.fiatCurrency,
torOnly: settingsStore.fiatApiMode == FiatApiMode.torOnly,
);
}.call();
}
@ -68,28 +73,6 @@ Future<void> startFiatRateUpdate(
// (btcln price is just the btc price divided by 100000000)
fiatConversionStore.prices[CryptoCurrency.btcln] =
(fiatConversionStore.prices[CryptoCurrency.btc] ?? 0) / 100000000;
if (appStore.wallet!.type == WalletType.solana) {
currencies =
solana!.getSPLTokenCurrencies(appStore.wallet!).where((element) => element.enabled);
}
if (appStore.wallet!.type == WalletType.tron) {
currencies =
tron!.getTronTokenCurrencies(appStore.wallet!).where((element) => element.enabled);
}
if (currencies != null) {
for (final currency in currencies) {
() async {
fiatConversionStore.prices[currency] = await FiatConversionService.fetchPrice(
crypto: currency,
fiat: settingsStore.fiatCurrency,
torOnly: settingsStore.fiatApiMode == FiatApiMode.torOnly);
}.call();
}
}
} catch (e) {
print(e);
}

View file

@ -31,7 +31,6 @@ import 'package:qr_flutter/qr_flutter.dart' as qr;
class LightningInvoicePage extends BasePage {
LightningInvoicePage({
required this.lightningViewModel,
required this.lightningInvoicePageViewModel,
required this.receiveOptionViewModel,
}) : _amountFocusNode = FocusNode() {}
@ -40,7 +39,6 @@ class LightningInvoicePage extends BasePage {
final _amountController = TextEditingController();
final FocusNode _amountFocusNode;
final LightningViewModel lightningViewModel;
final LightningInvoicePageViewModel lightningInvoicePageViewModel;
final ReceiveOptionViewModel receiveOptionViewModel;
final _formKey = GlobalKey<FormState>();