From 9e7009f3392b4092f73af8431c7a9e789bfe712f Mon Sep 17 00:00:00 2001 From: Omar Hatem Date: Mon, 17 Apr 2023 21:09:26 +0200 Subject: [PATCH] V4.6.2 Bug Fixes (#874) * Added a temporary workaround for empty receive addresses * Fix Typo in PR template * Make existing node private [skip ci] * Fix transactions page background color [skip ci] * Update ios version for internal test build [skip ci] * update macos version for internal test build [skip ci] --- .github/pull_request_template.md | 2 +- cw_bitcoin/lib/electrum_wallet_addresses.dart | 16 +++++++++++----- ios/Podfile.lock | 6 ++++++ .../dashboard/widgets/transactions_page.dart | 5 ++++- .../node_create_or_edit_view_model.dart | 6 +++--- scripts/ios/app_env.sh | 4 ++-- scripts/macos/app_env.sh | 4 ++-- 7 files changed, 29 insertions(+), 14 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4eb4ffac5..18ad16e4b 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,6 +8,6 @@ Please include a summary of the changes and which issue is fixed / feature is ad - [ ] Initial Manual Tests Passed - [ ] Double check modified code and verify it with the feature/task requirements -- [ ] Formate code +- [ ] Format code - [ ] Look for code duplication - [ ] Clear naming for variables and methods diff --git a/cw_bitcoin/lib/electrum_wallet_addresses.dart b/cw_bitcoin/lib/electrum_wallet_addresses.dart index eb7a0f61e..741c2fe1c 100644 --- a/cw_bitcoin/lib/electrum_wallet_addresses.dart +++ b/cw_bitcoin/lib/electrum_wallet_addresses.dart @@ -48,7 +48,13 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store { @override @computed - String get address => receiveAddresses.first.address; + String get address { + if (receiveAddresses.isEmpty) { + return generateNewAddress().address; + } + + return receiveAddresses.first.address; + } @override set address(String addr) => null; @@ -121,8 +127,8 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store { return address; } - Future generateNewAddress( - {bitcoin.HDWallet? hd, bool isHidden = false}) async { + BitcoinAddressRecord generateNewAddress( + {bitcoin.HDWallet? hd, bool isHidden = false}) { currentReceiveAddressIndex += 1; // FIX-ME: Check logic for whichi HD should be used here ??? final address = BitcoinAddressRecord( @@ -165,7 +171,7 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store { Future _discoverAddresses(bitcoin.HDWallet hd, bool isHidden) async { var hasAddrUse = true; List addrs; - + if (addresses.isNotEmpty) { addrs = addresses .where((addr) => addr.isHidden == isHidden) @@ -179,7 +185,7 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store { hd: hd, isHidden: isHidden); } - + while(hasAddrUse) { final addr = addrs.last.address; hasAddrUse = await _hasAddressUsed(addr); diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 658d55509..3a23117b2 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -146,6 +146,8 @@ PODS: - CryptoSwift - url_launcher_ios (0.0.1): - Flutter + - wakelock (0.0.1): + - Flutter DEPENDENCIES: - barcode_scan2 (from `.symlinks/plugins/barcode_scan2/ios`) @@ -173,6 +175,7 @@ DEPENDENCIES: - uni_links (from `.symlinks/plugins/uni_links/ios`) - UnstoppableDomainsResolution (~> 4.0.0) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) + - wakelock (from `.symlinks/plugins/wakelock/ios`) SPEC REPOS: https://github.com/CocoaPods/Specs.git: @@ -235,6 +238,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/uni_links/ios" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" + wakelock: + :path: ".symlinks/plugins/wakelock/ios" SPEC CHECKSUMS: barcode_scan2: 0af2bb63c81b4565aab6cd78278e4c0fa136dbb0 @@ -271,6 +276,7 @@ SPEC CHECKSUMS: uni_links: d97da20c7701486ba192624d99bffaaffcfc298a UnstoppableDomainsResolution: c3c67f4d0a5e2437cb00d4bd50c2e00d6e743841 url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4 + wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f PODFILE CHECKSUM: ae71bdf0eb731a1ffc399c122f6aa4dea0cb5f6f diff --git a/lib/src/screens/dashboard/widgets/transactions_page.dart b/lib/src/screens/dashboard/widgets/transactions_page.dart index de26d8da6..2efb38e89 100644 --- a/lib/src/screens/dashboard/widgets/transactions_page.dart +++ b/lib/src/screens/dashboard/widgets/transactions_page.dart @@ -1,5 +1,6 @@ import 'package:cake_wallet/src/screens/dashboard/widgets/anonpay_transaction_row.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/order_row.dart'; +import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:cake_wallet/view_model/dashboard/anonpay_transaction_list_item.dart'; import 'package:cake_wallet/view_model/dashboard/order_list_item.dart'; import 'package:cw_core/crypto_currency.dart'; @@ -25,7 +26,9 @@ class TransactionsPage extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - color: Theme.of(context).backgroundColor, + color: ResponsiveLayoutUtil.instance.isMobile(context) + ? null + : Theme.of(context).backgroundColor, padding: EdgeInsets.only(top: 24, bottom: 24), child: Column( children: [ diff --git a/lib/view_model/node_list/node_create_or_edit_view_model.dart b/lib/view_model/node_list/node_create_or_edit_view_model.dart index aba664fc7..5d84a27df 100644 --- a/lib/view_model/node_list/node_create_or_edit_view_model.dart +++ b/lib/view_model/node_list/node_create_or_edit_view_model.dart @@ -106,8 +106,8 @@ abstract class NodeCreateOrEditViewModelBase with Store { state = IsExecutingState(); if (editingNode != null) { await _nodeSource.put(editingNode.key, node); - } else if (existingNode(node) != null) { - setAsCurrent(existingNode(node)!); + } else if (_existingNode(node) != null) { + setAsCurrent(_existingNode(node)!); } else { await _nodeSource.add(node); setAsCurrent(_nodeSource.values.last); @@ -140,7 +140,7 @@ abstract class NodeCreateOrEditViewModelBase with Store { } } - Node? existingNode(Node node) { + Node? _existingNode(Node node) { final nodes = _nodeSource.values.toList(); nodes.forEach((item) { item.login ??= ''; diff --git a/scripts/ios/app_env.sh b/scripts/ios/app_env.sh index 998e48b68..3b700df46 100644 --- a/scripts/ios/app_env.sh +++ b/scripts/ios/app_env.sh @@ -18,8 +18,8 @@ MONERO_COM_BUILD_NUMBER=40 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="4.6.2" -CAKEWALLET_BUILD_NUMBER=145 +CAKEWALLET_VERSION="4.6.3" +CAKEWALLET_BUILD_NUMBER=146 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" HAVEN_NAME="Haven" diff --git a/scripts/macos/app_env.sh b/scripts/macos/app_env.sh index 3fceeb94d..8cb2d86b9 100755 --- a/scripts/macos/app_env.sh +++ b/scripts/macos/app_env.sh @@ -15,8 +15,8 @@ if [ -n "$1" ]; then fi CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="1.0.1" -CAKEWALLET_BUILD_NUMBER=11 +CAKEWALLET_VERSION="1.0.2" +CAKEWALLET_BUILD_NUMBER=12 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then