From f072e79bb6ca3f0c9ef65607509d4839d1c4d832 Mon Sep 17 00:00:00 2001 From: Omar Hatem Date: Tue, 27 Aug 2024 20:49:12 +0300 Subject: [PATCH] V4.19.5 v1.16.5 (#1654) * some not enough enhancements for sync status * update app versions * minor fix --- assets/text/Monerocom_Release_Notes.txt | 5 ++--- assets/text/Release_Notes.txt | 7 ++++--- cw_bitcoin/lib/electrum.dart | 12 +----------- cw_bitcoin/lib/electrum_wallet.dart | 10 ++++++---- cw_monero/lib/monero_wallet.dart | 4 +--- lib/reactions/check_connection.dart | 4 +++- lib/utils/exception_handler.dart | 1 - scripts/android/app_env.sh | 8 ++++---- scripts/ios/app_env.sh | 8 ++++---- scripts/linux/app_env.sh | 4 ++-- scripts/macos/app_env.sh | 8 ++++---- scripts/windows/build_exe_installer.iss | 2 +- tool/configure.dart | 2 +- 13 files changed, 33 insertions(+), 42 deletions(-) diff --git a/assets/text/Monerocom_Release_Notes.txt b/assets/text/Monerocom_Release_Notes.txt index 11a3ad803..fec1485ac 100644 --- a/assets/text/Monerocom_Release_Notes.txt +++ b/assets/text/Monerocom_Release_Notes.txt @@ -1,3 +1,2 @@ -Scan and verify messages -Synchronization enhancements -Bug fixes \ No newline at end of file +Enhance auto-address generation for Monero +Bug fixes and enhancements \ No newline at end of file diff --git a/assets/text/Release_Notes.txt b/assets/text/Release_Notes.txt index 11a3ad803..4e8a79fc1 100644 --- a/assets/text/Release_Notes.txt +++ b/assets/text/Release_Notes.txt @@ -1,3 +1,4 @@ -Scan and verify messages -Synchronization enhancements -Bug fixes \ No newline at end of file +Enable BIP39 by default for wallet creation also on Bitcoin/Litecoin (Electrum seed type is still accessible through advanced settings page) +Improve fee calculation for Bitcoin to protect against overpaying or underpaying +Enhance auto-address generation for Monero +Bug fixes and enhancements \ No newline at end of file diff --git a/cw_bitcoin/lib/electrum.dart b/cw_bitcoin/lib/electrum.dart index 6ac8edd1a..bc630a4e1 100644 --- a/cw_bitcoin/lib/electrum.dart +++ b/cw_bitcoin/lib/electrum.dart @@ -107,16 +107,9 @@ class ElectrumClient { } }, onError: (Object error) { - socket = null; final errorMsg = error.toString(); print(errorMsg); unterminatedString = ''; - - final currentHost = socket?.address.host; - final isErrorForCurrentHost = errorMsg.contains(" ${currentHost} "); - - if (currentHost != null && isErrorForCurrentHost) - _setConnectionStatus(ConnectionStatus.failed); }, onDone: () { unterminatedString = ''; @@ -436,7 +429,6 @@ class ElectrumClient { {required String id, required String method, List params = const []}) { try { if (socket == null) { - _setConnectionStatus(ConnectionStatus.failed); return null; } final subscription = BehaviorSubject(); @@ -453,7 +445,6 @@ class ElectrumClient { Future call( {required String method, List params = const [], Function(int)? idCallback}) async { if (socket == null) { - _setConnectionStatus(ConnectionStatus.failed); return null; } final completer = Completer(); @@ -467,10 +458,9 @@ class ElectrumClient { } Future callWithTimeout( - {required String method, List params = const [], int timeout = 4000}) async { + {required String method, List params = const [], int timeout = 5000}) async { try { if (socket == null) { - _setConnectionStatus(ConnectionStatus.failed); return null; } final completer = Completer(); diff --git a/cw_bitcoin/lib/electrum_wallet.dart b/cw_bitcoin/lib/electrum_wallet.dart index be4cee4d8..73ae7c38f 100644 --- a/cw_bitcoin/lib/electrum_wallet.dart +++ b/cw_bitcoin/lib/electrum_wallet.dart @@ -276,7 +276,6 @@ abstract class ElectrumWalletBase Future? _isolate; void Function(FlutterErrorDetails)? _onError; - Timer? _reconnectTimer; Timer? _autoSaveTimer; Timer? _updateFeeRateTimer; static const int _autoSaveInterval = 1; @@ -429,6 +428,10 @@ abstract class ElectrumWalletBase @override Future startSync() async { try { + if (syncStatus is SyncronizingSyncStatus) { + return; + } + syncStatus = SyncronizingSyncStatus(); if (hasSilentPaymentsScanning) { @@ -2055,9 +2058,8 @@ abstract class ElectrumWalletBase _isTryingToConnect = true; - _reconnectTimer?.cancel(); - _reconnectTimer = Timer(Duration(seconds: 10), () { - if (this.syncStatus is! SyncedSyncStatus && this.syncStatus is! SyncedTipSyncStatus) { + Timer(Duration(seconds: 10), () { + if (this.syncStatus is NotConnectedSyncStatus || this.syncStatus is LostConnectionSyncStatus) { this.electrumClient.connectToUri( node!.uri, useSSL: node!.useSSL ?? false, diff --git a/cw_monero/lib/monero_wallet.dart b/cw_monero/lib/monero_wallet.dart index 483ee8868..8dc3fdf86 100644 --- a/cw_monero/lib/monero_wallet.dart +++ b/cw_monero/lib/monero_wallet.dart @@ -13,11 +13,9 @@ import 'package:cw_core/monero_transaction_priority.dart'; import 'package:cw_core/monero_wallet_keys.dart'; import 'package:cw_core/monero_wallet_utils.dart'; import 'package:cw_core/node.dart'; -import 'package:cw_core/pathForWallet.dart'; import 'package:cw_core/pending_transaction.dart'; import 'package:cw_core/sync_status.dart'; import 'package:cw_core/transaction_direction.dart'; -import 'package:cw_core/transaction_priority.dart'; import 'package:cw_core/unspent_coins_info.dart'; import 'package:cw_core/wallet_base.dart'; import 'package:cw_core/wallet_info.dart'; @@ -88,7 +86,7 @@ abstract class MoneroWalletBase extends WalletBase isEnabledAutoGenerateSubaddress, (bool enabled) { _updateSubAddress(enabled, account: walletAddresses.account); }); - reaction((_) => transactionHistory, (__) { + _onTxHistoryChangeReaction = reaction((_) => transactionHistory, (__) { _updateSubAddress(isEnabledAutoGenerateSubaddress, account: walletAddresses.account); }); } diff --git a/lib/reactions/check_connection.dart b/lib/reactions/check_connection.dart index 3252797dd..812fa9fcd 100644 --- a/lib/reactions/check_connection.dart +++ b/lib/reactions/check_connection.dart @@ -24,7 +24,9 @@ void startCheckConnectionReaction(WalletBase wallet, SettingsStore settingsStore return; } - if (wallet.syncStatus is LostConnectionSyncStatus || wallet.syncStatus is FailedSyncStatus) { + if (wallet.type != WalletType.bitcoin && + (wallet.syncStatus is LostConnectionSyncStatus || + wallet.syncStatus is FailedSyncStatus)) { final alive = await settingsStore.getCurrentNode(wallet.type).requestNode(); if (alive) { diff --git a/lib/utils/exception_handler.dart b/lib/utils/exception_handler.dart index 8fc8a8c0e..dd58d3e56 100644 --- a/lib/utils/exception_handler.dart +++ b/lib/utils/exception_handler.dart @@ -172,7 +172,6 @@ class ExceptionHandler { "Error while launching http", "OS Error: Network is unreachable", "ClientException: Write failed, uri=http", - "Connection terminated during handshake", "Corrupted wallets seeds", "bad_alloc", "does not correspond", diff --git a/scripts/android/app_env.sh b/scripts/android/app_env.sh index 324d2d2ae..59919dcf8 100644 --- a/scripts/android/app_env.sh +++ b/scripts/android/app_env.sh @@ -15,15 +15,15 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN) APP_ANDROID_TYPE=$1 MONERO_COM_NAME="Monero.com" -MONERO_COM_VERSION="1.16.4" -MONERO_COM_BUILD_NUMBER=98 +MONERO_COM_VERSION="1.16.5" +MONERO_COM_BUILD_NUMBER=99 MONERO_COM_BUNDLE_ID="com.monero.app" MONERO_COM_PACKAGE="com.monero.app" MONERO_COM_SCHEME="monero.com" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="4.19.4" -CAKEWALLET_BUILD_NUMBER=225 +CAKEWALLET_VERSION="4.19.5" +CAKEWALLET_BUILD_NUMBER=226 CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet" CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet" CAKEWALLET_SCHEME="cakewallet" diff --git a/scripts/ios/app_env.sh b/scripts/ios/app_env.sh index 1405f7939..70530f4e6 100644 --- a/scripts/ios/app_env.sh +++ b/scripts/ios/app_env.sh @@ -13,13 +13,13 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN) APP_IOS_TYPE=$1 MONERO_COM_NAME="Monero.com" -MONERO_COM_VERSION="1.16.4" -MONERO_COM_BUILD_NUMBER=96 +MONERO_COM_VERSION="1.16.5" +MONERO_COM_BUILD_NUMBER=97 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="4.19.4" -CAKEWALLET_BUILD_NUMBER=263 +CAKEWALLET_VERSION="4.19.5" +CAKEWALLET_BUILD_NUMBER=264 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" HAVEN_NAME="Haven" diff --git a/scripts/linux/app_env.sh b/scripts/linux/app_env.sh index bc2965193..7f1b11f3f 100755 --- a/scripts/linux/app_env.sh +++ b/scripts/linux/app_env.sh @@ -14,8 +14,8 @@ if [ -n "$1" ]; then fi CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="1.9.4" -CAKEWALLET_BUILD_NUMBER=31 +CAKEWALLET_VERSION="1.9.5" +CAKEWALLET_BUILD_NUMBER=32 if ! [[ " ${TYPES[*]} " =~ " ${APP_LINUX_TYPE} " ]]; then echo "Wrong app type." diff --git a/scripts/macos/app_env.sh b/scripts/macos/app_env.sh index 342831d65..165feafe1 100755 --- a/scripts/macos/app_env.sh +++ b/scripts/macos/app_env.sh @@ -16,13 +16,13 @@ if [ -n "$1" ]; then fi MONERO_COM_NAME="Monero.com" -MONERO_COM_VERSION="1.6.4" -MONERO_COM_BUILD_NUMBER=28 +MONERO_COM_VERSION="1.6.5" +MONERO_COM_BUILD_NUMBER=30 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="1.12.4" -CAKEWALLET_BUILD_NUMBER=85 +CAKEWALLET_VERSION="1.12.5" +CAKEWALLET_BUILD_NUMBER=86 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then diff --git a/scripts/windows/build_exe_installer.iss b/scripts/windows/build_exe_installer.iss index 4d7838723..bb13f49ef 100644 --- a/scripts/windows/build_exe_installer.iss +++ b/scripts/windows/build_exe_installer.iss @@ -1,5 +1,5 @@ #define MyAppName "Cake Wallet" -#define MyAppVersion "0.0.5" +#define MyAppVersion "0.0.6" #define MyAppPublisher "Cake Labs LLC" #define MyAppURL "https://cakewallet.com/" #define MyAppExeName "CakeWallet.exe" diff --git a/tool/configure.dart b/tool/configure.dart index b3194c4c8..1d2166ed6 100644 --- a/tool/configure.dart +++ b/tool/configure.dart @@ -79,7 +79,6 @@ import 'dart:typed_data'; import 'package:bitcoin_base/bitcoin_base.dart'; import 'package:cake_wallet/view_model/hardware_wallet/ledger_view_model.dart'; import 'package:cake_wallet/view_model/send/output.dart'; -import 'package:cw_bitcoin/electrum_transaction_info.dart'; import 'package:cw_core/hardware/hardware_account_data.dart'; import 'package:cw_core/node.dart'; import 'package:cw_core/output_info.dart'; @@ -102,6 +101,7 @@ import 'package:bip39/bip39.dart' as bip39; import 'package:cw_bitcoin/utils.dart'; import 'package:cw_bitcoin/electrum_derivations.dart'; import 'package:cw_bitcoin/electrum.dart'; +import 'package:cw_bitcoin/electrum_transaction_info.dart'; import 'package:cw_bitcoin/pending_bitcoin_transaction.dart'; import 'package:cw_bitcoin/bitcoin_receive_page_option.dart'; import 'package:cw_bitcoin/bitcoin_wallet.dart';