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]

Omar Hatem committed Apr 17, 2023 at 21:09 UTC 9e7009f3392b4092f73af8431c7a9e789bfe712f
7 files changed +29 -14
.github/pull_request_template.md
+1 -1
@@ -8,6 +8,6 @@ Please include a summary of the changes and which issue is fixed / feature is ad
8
9 - [ ] Initial Manual Tests Passed
10 - [ ] Double check modified code and verify it with the feature/task requirements
11 -- [ ] Formate code
11 +- [ ] Format code
12 - [ ] Look for code duplication
13 - [ ] Clear naming for variables and methods
cw_bitcoin/lib/electrum_wallet_addresses.dart
+11 -5
@@ -48,7 +48,13 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
48
49 @override
50 @computed
51 - String get address => receiveAddresses.first.address;
51 + String get address {
52 + if (receiveAddresses.isEmpty) {
53 + return generateNewAddress().address;
54 + }
55 +
56 + return receiveAddresses.first.address;
57 + }
58
59 @override
60 set address(String addr) => null;
@@ -121,8 +127,8 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
127 return address;
128 }
129
124 - Future<BitcoinAddressRecord> generateNewAddress(
125 - {bitcoin.HDWallet? hd, bool isHidden = false}) async {
130 + BitcoinAddressRecord generateNewAddress(
131 + {bitcoin.HDWallet? hd, bool isHidden = false}) {
132 currentReceiveAddressIndex += 1;
133 // FIX-ME: Check logic for whichi HD should be used here ???
134 final address = BitcoinAddressRecord(
@@ -165,7 +171,7 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
171 Future<void> _discoverAddresses(bitcoin.HDWallet hd, bool isHidden) async {
172 var hasAddrUse = true;
173 List<BitcoinAddressRecord> addrs;
168 -
174 +
175 if (addresses.isNotEmpty) {
176 addrs = addresses
177 .where((addr) => addr.isHidden == isHidden)
@@ -179,7 +185,7 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
185 hd: hd,
186 isHidden: isHidden);
187 }
182 -
188 +
189 while(hasAddrUse) {
190 final addr = addrs.last.address;
191 hasAddrUse = await _hasAddressUsed(addr);
ios/Podfile.lock
+6
@@ -146,6 +146,8 @@ PODS:
146 - CryptoSwift
147 - url_launcher_ios (0.0.1):
148 - Flutter
149 + - wakelock (0.0.1):
150 + - Flutter
151
152 DEPENDENCIES:
153 - barcode_scan2 (from `.symlinks/plugins/barcode_scan2/ios`)
@@ -173,6 +175,7 @@ DEPENDENCIES:
175 - uni_links (from `.symlinks/plugins/uni_links/ios`)
176 - UnstoppableDomainsResolution (~> 4.0.0)
177 - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
178 + - wakelock (from `.symlinks/plugins/wakelock/ios`)
179
180 SPEC REPOS:
181 https://github.com/CocoaPods/Specs.git:
@@ -235,6 +238,8 @@ EXTERNAL SOURCES:
238 :path: ".symlinks/plugins/uni_links/ios"
239 url_launcher_ios:
240 :path: ".symlinks/plugins/url_launcher_ios/ios"
241 + wakelock:
242 + :path: ".symlinks/plugins/wakelock/ios"
243
244 SPEC CHECKSUMS:
245 barcode_scan2: 0af2bb63c81b4565aab6cd78278e4c0fa136dbb0
@@ -271,6 +276,7 @@ SPEC CHECKSUMS:
276 uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
277 UnstoppableDomainsResolution: c3c67f4d0a5e2437cb00d4bd50c2e00d6e743841
278 url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
279 + wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
280
281 PODFILE CHECKSUM: ae71bdf0eb731a1ffc399c122f6aa4dea0cb5f6f
282
lib/src/screens/dashboard/widgets/transactions_page.dart
+4 -1
@@ -1,5 +1,6 @@
1 import 'package:cake_wallet/src/screens/dashboard/widgets/anonpay_transaction_row.dart';
2 import 'package:cake_wallet/src/screens/dashboard/widgets/order_row.dart';
3 +import 'package:cake_wallet/utils/responsive_layout_util.dart';
4 import 'package:cake_wallet/view_model/dashboard/anonpay_transaction_list_item.dart';
5 import 'package:cake_wallet/view_model/dashboard/order_list_item.dart';
6 import 'package:cw_core/crypto_currency.dart';
@@ -25,7 +26,9 @@ class TransactionsPage extends StatelessWidget {
26 @override
27 Widget build(BuildContext context) {
28 return Container(
28 - color: Theme.of(context).backgroundColor,
29 + color: ResponsiveLayoutUtil.instance.isMobile(context)
30 + ? null
31 + : Theme.of(context).backgroundColor,
32 padding: EdgeInsets.only(top: 24, bottom: 24),
33 child: Column(
34 children: <Widget>[
lib/view_model/node_list/node_create_or_edit_view_model.dart
+3 -3
@@ -106,8 +106,8 @@ abstract class NodeCreateOrEditViewModelBase with Store {
106 state = IsExecutingState();
107 if (editingNode != null) {
108 await _nodeSource.put(editingNode.key, node);
109 - } else if (existingNode(node) != null) {
110 - setAsCurrent(existingNode(node)!);
109 + } else if (_existingNode(node) != null) {
110 + setAsCurrent(_existingNode(node)!);
111 } else {
112 await _nodeSource.add(node);
113 setAsCurrent(_nodeSource.values.last);
@@ -140,7 +140,7 @@ abstract class NodeCreateOrEditViewModelBase with Store {
140 }
141 }
142
143 - Node? existingNode(Node node) {
143 + Node? _existingNode(Node node) {
144 final nodes = _nodeSource.values.toList();
145 nodes.forEach((item) {
146 item.login ??= '';
scripts/ios/app_env.sh
+2 -2
@@ -18,8 +18,8 @@ MONERO_COM_BUILD_NUMBER=40
18 MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
19
20 CAKEWALLET_NAME="Cake Wallet"
21 -CAKEWALLET_VERSION="4.6.2"
22 -CAKEWALLET_BUILD_NUMBER=145
21 +CAKEWALLET_VERSION="4.6.3"
22 +CAKEWALLET_BUILD_NUMBER=146
23 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
24
25 HAVEN_NAME="Haven"
scripts/macos/app_env.sh
+2 -2
@@ -15,8 +15,8 @@ if [ -n "$1" ]; then
15 fi
16
17 CAKEWALLET_NAME="Cake Wallet"
18 -CAKEWALLET_VERSION="1.0.1"
19 -CAKEWALLET_BUILD_NUMBER=11
18 +CAKEWALLET_VERSION="1.0.2"
19 +CAKEWALLET_BUILD_NUMBER=12
20 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
21
22 if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then