From 5faf7f5cbaaa23d78575d1e9e072fc008fa77ec4 Mon Sep 17 00:00:00 2001 From: M Date: Wed, 14 Apr 2021 11:54:12 +0300 Subject: [PATCH 1/2] CAKE-310. CAKE-309. Bugs fixes. Changed way for save wallet after adding of new account/subaddress. Added App transport security rule for iOS. Changed version to 4.1.5. --- cw_monero/lib/account_list.dart | 14 ++++++++++---- cw_monero/lib/subaddress_list.dart | 21 +++++++++++++-------- ios/Runner.xcodeproj/project.pbxproj | 12 ++++++------ ios/Runner/Info.plist | 5 +++++ lib/monero/monero_wallet.dart | 2 -- pubspec.yaml | 2 +- 6 files changed, 35 insertions(+), 21 deletions(-) diff --git a/cw_monero/lib/account_list.dart b/cw_monero/lib/account_list.dart index 6e84f59315..79342cf3b2 100644 --- a/cw_monero/lib/account_list.dart +++ b/cw_monero/lib/account_list.dart @@ -5,6 +5,7 @@ import 'package:cw_monero/types.dart'; import 'package:cw_monero/monero_api.dart'; import 'package:cw_monero/structs/account_row.dart'; import 'package:flutter/foundation.dart'; +import 'package:cw_monero/wallet.dart'; final accountSizeNative = moneroApi .lookup>('account_size') @@ -70,8 +71,13 @@ void _setLabelForAccount(Map args) { setLabelForAccountSync(label: label, accountIndex: accountIndex); } -Future addAccount({String label}) async => compute(_addAccount, label); +Future addAccount({String label}) async { + await compute(_addAccount, label); + await store(); +} -Future setLabelForAccount({int accountIndex, String label}) async => - compute( - _setLabelForAccount, {'accountIndex': accountIndex, 'label': label}); \ No newline at end of file +Future setLabelForAccount({int accountIndex, String label}) async { + await compute( + _setLabelForAccount, {'accountIndex': accountIndex, 'label': label}); + await store(); +} \ No newline at end of file diff --git a/cw_monero/lib/subaddress_list.dart b/cw_monero/lib/subaddress_list.dart index 97a3070406..caa0fffd3a 100644 --- a/cw_monero/lib/subaddress_list.dart +++ b/cw_monero/lib/subaddress_list.dart @@ -5,6 +5,7 @@ import 'package:cw_monero/signatures.dart'; import 'package:cw_monero/types.dart'; import 'package:cw_monero/monero_api.dart'; import 'package:cw_monero/structs/subaddress_row.dart'; +import 'package:cw_monero/wallet.dart'; final subaddressSizeNative = moneroApi .lookup>('subaddrress_size') @@ -79,14 +80,18 @@ void _setLabelForSubaddress(Map args) { accountIndex: accountIndex, addressIndex: addressIndex, label: label); } -Future addSubaddress({int accountIndex, String label}) async => - compute, void>( +Future addSubaddress({int accountIndex, String label}) async { + await compute, void>( _addSubaddress, {'accountIndex': accountIndex, 'label': label}); + await store(); +} Future setLabelForSubaddress( - {int accountIndex, int addressIndex, String label}) => - compute, void>(_setLabelForSubaddress, { - 'accountIndex': accountIndex, - 'addressIndex': addressIndex, - 'label': label - }); + {int accountIndex, int addressIndex, String label}) async { + await compute, void>(_setLabelForSubaddress, { + 'accountIndex': accountIndex, + 'addressIndex': addressIndex, + 'label': label + }); + await store(); +} diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 4ac94e6383..6e3df44f7f 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -358,7 +358,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 33; + CURRENT_PROJECT_VERSION = 34; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -375,7 +375,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.1.4; + MARKETING_VERSION = 4.1.5; PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -501,7 +501,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 33; + CURRENT_PROJECT_VERSION = 34; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -518,7 +518,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.1.4; + MARKETING_VERSION = 4.1.5; PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -536,7 +536,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 33; + CURRENT_PROJECT_VERSION = 34; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -553,7 +553,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.1.4; + MARKETING_VERSION = 4.1.5; PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 89cd769e0a..970c892cd0 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -24,6 +24,11 @@ $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSCameraUsageDescription Used for scan QR code NSDocumentsFolderUsageDescription diff --git a/lib/monero/monero_wallet.dart b/lib/monero/monero_wallet.dart index ac7f0cd94d..0891100c89 100644 --- a/lib/monero/monero_wallet.dart +++ b/lib/monero/monero_wallet.dart @@ -100,10 +100,8 @@ abstract class MoneroWalletBase extends WalletBase with Store { Future init() async { accountList.update(); - accountList.accounts.observe((_) async => await save()); account = accountList.accounts.first; subaddressList.update(accountIndex: account.id ?? 0); - subaddressList.subaddresses.observe((_) async => await save()); subaddress = subaddressList.getAll().first; balance = MoneroBalance( fullBalance: monero_wallet.getFullBalance(accountIndex: account.id), diff --git a/pubspec.yaml b/pubspec.yaml index e93b34fa62..388b8a5f2e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Cake Wallet. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 4.1.4+43 +version: 4.1.5+44 environment: sdk: ">=2.7.0 <3.0.0" From d23228ac01f85339cfd4ba2859a52f2941a21e1a Mon Sep 17 00:00:00 2001 From: M Date: Wed, 21 Apr 2021 11:59:13 +0300 Subject: [PATCH 2/2] Updated bitcoin slow transaction priority. Changed version to 4.1.6. --- ios/Runner.xcodeproj/project.pbxproj | 12 ++++++------ lib/bitcoin/bitcoin_transaction_priority.dart | 2 +- lib/bitcoin/electrum.dart | 13 +++++++++---- lib/store/app_store.dart | 2 +- pubspec.yaml | 2 +- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 6e3df44f7f..a60dfb75f6 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -358,7 +358,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 34; + CURRENT_PROJECT_VERSION = 35; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -375,7 +375,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.1.5; + MARKETING_VERSION = 4.1.6; PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -501,7 +501,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 34; + CURRENT_PROJECT_VERSION = 35; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -518,7 +518,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.1.5; + MARKETING_VERSION = 4.1.6; PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -536,7 +536,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 34; + CURRENT_PROJECT_VERSION = 35; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -553,7 +553,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.1.5; + MARKETING_VERSION = 4.1.6; PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/lib/bitcoin/bitcoin_transaction_priority.dart b/lib/bitcoin/bitcoin_transaction_priority.dart index 71002819ba..9e2fbc24ba 100644 --- a/lib/bitcoin/bitcoin_transaction_priority.dart +++ b/lib/bitcoin/bitcoin_transaction_priority.dart @@ -32,7 +32,7 @@ class BitcoinTransactionPriority extends TransactionPriority { switch (this) { case BitcoinTransactionPriority.slow: - label = S.current.transaction_priority_slow; + label = '${S.current.transaction_priority_slow} ~24hrs'; break; case BitcoinTransactionPriority.medium: label = S.current.transaction_priority_medium; diff --git a/lib/bitcoin/electrum.dart b/lib/bitcoin/electrum.dart index 29e85afa57..2592d2c224 100644 --- a/lib/bitcoin/electrum.dart +++ b/lib/bitcoin/electrum.dart @@ -305,10 +305,15 @@ class ElectrumClient { Future> feeRates() async { final topDoubleString = await estimatefee(p: 1); final middleDoubleString = await estimatefee(p: 20); - final bottomDoubleString = await estimatefee(p: 150); - final top = (stringDoubleToBitcoinAmount(topDoubleString.toString()) / 1000).round(); - final middle = (stringDoubleToBitcoinAmount(middleDoubleString.toString()) / 1000).round(); - final bottom = (stringDoubleToBitcoinAmount(bottomDoubleString.toString()) / 1000).round(); + final bottomDoubleString = await estimatefee(p: 100); + final top = (stringDoubleToBitcoinAmount(topDoubleString.toString()) / 1000) + .round(); + final middle = + (stringDoubleToBitcoinAmount(middleDoubleString.toString()) / 1000) + .round(); + final bottom = + (stringDoubleToBitcoinAmount(bottomDoubleString.toString()) / 1000) + .round(); return [bottom, middle, top]; } diff --git a/lib/store/app_store.dart b/lib/store/app_store.dart index 06e0de1b22..e90b763752 100644 --- a/lib/store/app_store.dart +++ b/lib/store/app_store.dart @@ -29,7 +29,7 @@ abstract class AppStoreBase with Store { NodeListStore nodeListStore; @action - void changeCurrentWallet(WalletBase wallet) { + void changeCurrentWallet(WalletBase wallet) { this.wallet?.close(); this.wallet = wallet; } diff --git a/pubspec.yaml b/pubspec.yaml index 388b8a5f2e..15ccf8cec5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Cake Wallet. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 4.1.5+44 +version: 4.1.6+45 environment: sdk: ">=2.7.0 <3.0.0"