diff --git a/cw_monero/ios/Classes/monero_api.cpp b/cw_monero/ios/Classes/monero_api.cpp index 4398043d0..019f38ed2 100644 --- a/cw_monero/ios/Classes/monero_api.cpp +++ b/cw_monero/ios/Classes/monero_api.cpp @@ -351,13 +351,11 @@ extern "C" uint64_t get_full_balance(uint32_t account_index) { -// return 0; return get_current_wallet()->balance(account_index); } uint64_t get_unlocked_balance(uint32_t account_index) { -// return 0; return get_current_wallet()->unlockedBalance(account_index); } diff --git a/lib/main.dart b/lib/main.dart index 73cd58d1f..9cd55e054 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -29,47 +29,59 @@ import 'package:cake_wallet/src/screens/root/root.dart'; final navigatorKey = GlobalKey(); void main() async { - WidgetsFlutterBinding.ensureInitialized(); + try { + WidgetsFlutterBinding.ensureInitialized(); - final appDir = await getApplicationDocumentsDirectory(); - Hive.init(appDir.path); - Hive.registerAdapter(ContactAdapter()); - Hive.registerAdapter(NodeAdapter()); - Hive.registerAdapter(TransactionDescriptionAdapter()); - Hive.registerAdapter(TradeAdapter()); - Hive.registerAdapter(WalletInfoAdapter()); - Hive.registerAdapter(WalletTypeAdapter()); - Hive.registerAdapter(TemplateAdapter()); - Hive.registerAdapter(ExchangeTemplateAdapter()); - - final secureStorage = FlutterSecureStorage(); - final transactionDescriptionsBoxKey = await getEncryptionKey( - secureStorage: secureStorage, forKey: TransactionDescription.boxKey); - final tradesBoxKey = await getEncryptionKey( - secureStorage: secureStorage, forKey: Trade.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 walletInfoSource = await Hive.openBox(WalletInfo.boxName); - final templates = await Hive.openBox