diff --git a/cw_core/lib/sync_status.dart b/cw_core/lib/sync_status.dart index 4983967d0..a1bd43d2b 100644 --- a/cw_core/lib/sync_status.dart +++ b/cw_core/lib/sync_status.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + abstract class SyncStatus { const SyncStatus(); double progress(); @@ -51,4 +53,6 @@ class ConnectedSyncStatus extends SyncStatus { class LostConnectionSyncStatus extends SyncStatus { @override double progress() => 1.0; -} \ No newline at end of file +} + +Completer syncCompleter = Completer(); diff --git a/cw_monero/lib/monero_wallet.dart b/cw_monero/lib/monero_wallet.dart index eceb30654..5555973e4 100644 --- a/cw_monero/lib/monero_wallet.dart +++ b/cw_monero/lib/monero_wallet.dart @@ -380,9 +380,11 @@ abstract class MoneroWalletBase extends WalletBase main() async { /// A callback that is invoked when an unhandled error occurs in the root /// isolate. PlatformDispatcher.instance.onError = (error, stack) { - ExceptionHandler.onError(FlutterErrorDetails(exception: error, stack: stack)); + ExceptionHandler.onError( + FlutterErrorDetails(exception: error, stack: stack)); return true; }; @@ -106,25 +107,32 @@ Future main() async { } final secureStorage = FlutterSecureStorage(); - final transactionDescriptionsBoxKey = - await getEncryptionKey(secureStorage: secureStorage, forKey: TransactionDescription.boxKey); - final tradesBoxKey = await getEncryptionKey(secureStorage: secureStorage, forKey: Trade.boxKey); - final ordersBoxKey = await getEncryptionKey(secureStorage: secureStorage, forKey: Order.boxKey); + final transactionDescriptionsBoxKey = await getEncryptionKey( + secureStorage: secureStorage, forKey: TransactionDescription.boxKey); + final tradesBoxKey = await getEncryptionKey( + secureStorage: secureStorage, forKey: Trade.boxKey); + final ordersBoxKey = await getEncryptionKey( + secureStorage: secureStorage, forKey: Order.boxKey); final contacts = await Hive.openBox(Contact.boxName); final nodes = await Hive.openBox(Node.boxName); final transactionDescriptions = await Hive.openBox( TransactionDescription.boxName, encryptionKey: transactionDescriptionsBoxKey); - final trades = await Hive.openBox(Trade.boxName, encryptionKey: tradesBoxKey); - final orders = await Hive.openBox(Order.boxName, encryptionKey: ordersBoxKey); + final trades = + await Hive.openBox(Trade.boxName, encryptionKey: tradesBoxKey); + final orders = + await Hive.openBox(Order.boxName, encryptionKey: ordersBoxKey); final walletInfoSource = await Hive.openBox(WalletInfo.boxName); final templates = await Hive.openBox