From d5977d5d3d11913006920b4a4e852d12390ba513 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 20 Sep 2023 08:57:27 -0600 Subject: [PATCH 1/4] remove unused --- lib/pages/exchange_view/exchange_form.dart | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/pages/exchange_view/exchange_form.dart b/lib/pages/exchange_view/exchange_form.dart index 49a44071d..a233a35c7 100644 --- a/lib/pages/exchange_view/exchange_form.dart +++ b/lib/pages/exchange_view/exchange_form.dart @@ -36,7 +36,6 @@ import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart import 'package:stackwallet/services/exchange/exchange_response.dart'; import 'package:stackwallet/services/exchange/majestic_bank/majestic_bank_exchange.dart'; import 'package:stackwallet/services/exchange/trocador/trocador_exchange.dart'; -import 'package:stackwallet/services/tor_service.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount_unit.dart'; import 'package:stackwallet/utilities/assets.dart'; @@ -780,9 +779,6 @@ class _ExchangeFormState extends ConsumerState { }); } - // Instantiate the Tor service. - torService = TorService.sharedInstance; - super.initState(); } @@ -1017,7 +1013,4 @@ class _ExchangeFormState extends ConsumerState { ], ); } - - // TorService instance. - late TorService torService; } From 67c73076a2de9897885a5e494ba05d82a5844120 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 20 Sep 2023 09:10:29 -0600 Subject: [PATCH 2/4] run loading futures together --- .../exchange/exchange_data_loading_service.dart | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/services/exchange/exchange_data_loading_service.dart b/lib/services/exchange/exchange_data_loading_service.dart index eecb80462..6b34fd438 100644 --- a/lib/services/exchange/exchange_data_loading_service.dart +++ b/lib/services/exchange/exchange_data_loading_service.dart @@ -162,18 +162,21 @@ class ExchangeDataLoadingService { // await _loadChangeNowEstimatedRatePairs(); */ + // Exchanges which support Tor just get treated normally. + final futures = [ + loadMajesticBankCurrencies(), + loadTrocadorCurrencies(), + ]; + // If using Tor, don't load data for exchanges which don't support Tor. // // Add to this list when adding an exchange which doesn't supports Tor. if (!Prefs.instance.useTor) { - await _loadChangeNowCurrencies(); + futures.add(_loadChangeNowCurrencies()); } - // Exchanges which support Tor just get treated normally. - await Future.wait([ - loadMajesticBankCurrencies(), - loadTrocadorCurrencies(), - ]); + // wait for all loading futures to complete + await Future.wait(futures); Logging.instance.log( "ExchangeDataLoadingService.loadAll finished in ${DateTime.now().difference(start).inSeconds} seconds", From c2489cdd68cb896b24eb04dc180e1d6fbcf3f7e4 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 20 Sep 2023 09:16:35 -0600 Subject: [PATCH 3/4] remove tor build scripts --- scripts/android/build_all.sh | 1 - scripts/linux/build_all.sh | 1 - 2 files changed, 2 deletions(-) diff --git a/scripts/android/build_all.sh b/scripts/android/build_all.sh index 111fea934..a0050dc9e 100755 --- a/scripts/android/build_all.sh +++ b/scripts/android/build_all.sh @@ -7,7 +7,6 @@ mkdir build (cd ../../crypto_plugins/flutter_liblelantus/scripts/android && ./build_all.sh ) & (cd ../../crypto_plugins/flutter_libepiccash/scripts/android && ./install_ndk.sh && ./build_all.sh ) & (cd ../../crypto_plugins/flutter_libmonero/scripts/android/ && ./build_all.sh ) & -(cd ../../crypto_plugins/tor/scripts/android && ./install_ndk.sh && ./build_all.sh ) & wait echo "Done building" diff --git a/scripts/linux/build_all.sh b/scripts/linux/build_all.sh index 9a119d0d6..31edfb872 100755 --- a/scripts/linux/build_all.sh +++ b/scripts/linux/build_all.sh @@ -9,7 +9,6 @@ mkdir -p build (cd ../../crypto_plugins/flutter_liblelantus/scripts/linux && ./build_all.sh ) & (cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) & (cd ../../crypto_plugins/flutter_libmonero/scripts/linux && ./build_monero_all.sh && ./build_sharedfile.sh ) & -(cd ../../crypto_plugins/tor/scripts/linux && ./build_all.sh ) & wait echo "Done building" From eec0d2d7df1170c1aa0226999c99148488f66043 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 20 Sep 2023 10:58:40 -0500 Subject: [PATCH 4/4] revert firo changes to wallet settings view --- .../wallet_settings_view.dart | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart index fcacc60d4..6b7e57bef 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart @@ -13,6 +13,7 @@ import 'dart:async'; import 'package:event_bus/event_bus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/models/epicbox_config_model.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/address_book_views/address_book_view.dart'; @@ -36,11 +37,14 @@ import 'package:stackwallet/services/event_bus/global_event_bus.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/show_loading.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/background.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; +import 'package:stackwallet/widgets/desktop/secondary_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; +import 'package:stackwallet/widgets/stack_dialog.dart'; import 'package:tuple/tuple.dart'; /// [eventBus] should only be set during testing @@ -306,6 +310,61 @@ class _WalletSettingsViewState extends ConsumerState { ); }, ), + if (coin == Coin.firo) + const SizedBox( + height: 8, + ), + if (coin == Coin.firo) + Consumer( + builder: (_, ref, __) { + return SettingsListButton( + iconAssetName: Assets.svg.eye, + title: "Clear electrumx cache", + onPressed: () async { + String? result; + await showDialog( + useSafeArea: false, + barrierDismissible: true, + context: context, + builder: (_) => StackOkDialog( + title: + "Are you sure you want to clear " + "${coin.prettyName} electrumx cache?", + onOkPressed: (value) { + result = value; + }, + leftButton: SecondaryButton( + label: "Cancel", + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ), + ); + + if (result == "OK" && mounted) { + await showLoading( + whileFuture: Future.wait( + [ + Future.delayed( + const Duration( + milliseconds: 1500, + ), + ), + DB.instance + .clearSharedTransactionCache( + coin: coin, + ), + ], + ), + context: context, + message: "Clearing cache...", + ); + } + }, + ); + }, + ), if (coin == Coin.nano || coin == Coin.banano) const SizedBox( height: 8,