Skip to content

Commit

Permalink
4.22.1 RC (#1932)
Browse files Browse the repository at this point in the history
* 4.22.1 RC

* minor cleanup [skip ci]

* Fix frozen balance not displaying at startup issue

* Monero balance tx display issue (#1934)

* minor cleanup [skip ci]

* Fix frozen balance not displaying at startup issue

* fix transactions not updating (stupid mobx reactions :3)

* [skip ci]
  • Loading branch information
OmarHatem28 authored Jan 5, 2025
1 parent cee3abc commit d1c45a5
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 54 deletions.
5 changes: 2 additions & 3 deletions assets/text/Monerocom_Release_Notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Support Monero Ledger
Bug fixes
New designs and better user experience
UI enhancements
Bug fixes
9 changes: 4 additions & 5 deletions assets/text/Release_Notes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Support Monero Ledger
Prepare for Haven removal
Improve Ethereum and Polygon sending process
Bug fixes
New designs and better user experience
Bitcoin and Litecoin enhancements
Solana and Nano fixes/improvements
UI enhancements
Bug fixes
34 changes: 7 additions & 27 deletions cw_monero/lib/monero_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:cw_core/pathForWallet.dart';
import 'package:cw_core/transaction_priority.dart';
import 'package:cw_core/account.dart';
import 'package:cw_core/crypto_currency.dart';
import 'package:cw_core/monero_amount_format.dart';
import 'package:cw_core/monero_balance.dart';
import 'package:cw_core/monero_transaction_priority.dart';
import 'package:cw_core/monero_wallet_keys.dart';
Expand All @@ -28,7 +27,6 @@ import 'package:cw_monero/api/transaction_history.dart' as transaction_history;
import 'package:cw_monero/api/wallet.dart' as monero_wallet;
import 'package:cw_monero/api/wallet_manager.dart';
import 'package:cw_monero/exceptions/monero_transaction_creation_exception.dart';
import 'package:cw_monero/exceptions/monero_transaction_no_inputs_exception.dart';
import 'package:cw_monero/ledger.dart';
import 'package:cw_monero/monero_transaction_creation_credentials.dart';
import 'package:cw_monero/monero_transaction_history.dart';
Expand Down Expand Up @@ -58,8 +56,9 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
required String password})
: balance = ObservableMap<CryptoCurrency, MoneroBalance>.of({
CryptoCurrency.xmr: MoneroBalance(
fullBalance: monero_wallet.getFullBalance(accountIndex: 0),
unlockedBalance: monero_wallet.getFullBalance(accountIndex: 0))
fullBalance: monero_wallet.getFullBalance(accountIndex: 0),
unlockedBalance: monero_wallet.getUnlockedBalance(accountIndex: 0),
)
}),
_isTransactionUpdating = false,
_hasSyncAfterStartup = false,
Expand Down Expand Up @@ -281,7 +280,6 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
final hasMultiDestination = outputs.length > 1;
final unlockedBalance = monero_wallet.getUnlockedBalance(
accountIndex: walletAddresses.account!.id);
var allInputsAmount = 0;

PendingTransactionDescription pendingTransactionDescription;

Expand All @@ -295,11 +293,9 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,

for (final utx in unspentCoins) {
if (utx.isSending) {
allInputsAmount += utx.value;
inputs.add(utx.keyImage!);
}
}
final spendAllCoins = inputs.length == unspentCoins.length;

if (hasMultiDestination) {
if (outputs.any(
Expand All @@ -311,8 +307,6 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
final int totalAmount = outputs.fold(
0, (acc, value) => acc + (value.formattedCryptoAmount ?? 0));

final estimatedFee =
calculateEstimatedFee(_credentials.priority, totalAmount);
if (unlockedBalance < totalAmount) {
throw MoneroTransactionCreationException(
'You do not have enough XMR to send this amount.');
Expand Down Expand Up @@ -342,8 +336,6 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
output.isParsedAddress ? output.extractedAddress : output.address;
final amount =
output.sendAll ? null : output.cryptoAmount!.replaceAll(',', '.');
final formattedAmount =
output.sendAll ? null : output.formattedCryptoAmount;

// if ((formattedAmount != null && unlockedBalance < formattedAmount) ||
// (formattedAmount == null && unlockedBalance <= 0)) {
Expand All @@ -353,8 +345,6 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
// 'You do not have enough unlocked balance. Unlocked: $formattedBalance. Transaction amount: ${output.cryptoAmount}.');
// }

final estimatedFee =
calculateEstimatedFee(_credentials.priority, formattedAmount);
if (inputs.isEmpty) MoneroTransactionCreationException(
'No inputs selected');
pendingTransactionDescription =
Expand Down Expand Up @@ -750,26 +740,16 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
Future<void> _askForUpdateTransactionHistory() async =>
await updateTransactions();

int _getFullBalance() =>
monero_wallet.getFullBalance(accountIndex: walletAddresses.account!.id);

int _getUnlockedBalance() => monero_wallet.getUnlockedBalance(
accountIndex: walletAddresses.account!.id);

int _getFrozenBalance() {
var frozenBalance = 0;

unspentCoinsInfo.values.forEach((info) {
unspentCoins.forEach((element) {
if (element.hash == info.hash &&
element.vout == info.vout &&
info.isFrozen &&
element.value == info.value && info.walletId == id &&
info.accountIndex == walletAddresses.account!.id) {
if (element.isFrozen && !element.isSending) frozenBalance+= element.value;
}
});
});
for (var coin in unspentCoinsInfo.values.where((element) =>
element.walletId == id && element.accountIndex == walletAddresses.account!.id)) {
if (coin.isFrozen && !coin.isSending) frozenBalance += coin.value;
}

return frozenBalance;
}
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ SPEC CHECKSUMS:
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
universal_ble: cf52a7b3fd2e7c14d6d7262e9fdadb72ab6b88a6
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
wakelock_plus: 373cfe59b235a6dd5837d0fb88791d2f13a90d56
workmanager: 0afdcf5628bbde6924c21af7836fed07b42e30e6

PODFILE CHECKSUM: e448f662d4c41f0c0b1ccbb78afd57dbf895a597
Expand Down
6 changes: 3 additions & 3 deletions lib/view_model/dashboard/dashboard_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ abstract class DashboardViewModelBase with Store {

transactions.clear();

transactions = ObservableList.of(
transactions.addAll(
wallet.transactionHistory.transactions.values.map(
(transaction) => TransactionListItem(
transaction: transaction,
Expand Down Expand Up @@ -703,7 +703,7 @@ abstract class DashboardViewModelBase with Store {
monero!.getTransactionInfoAccountId(tx) == monero!.getCurrentAccount(wallet).id)
.toList();

transactions = ObservableList.of(
transactions.addAll(
_accountTransactions.map(
(transaction) => TransactionListItem(
transaction: transaction,
Expand All @@ -723,7 +723,7 @@ abstract class DashboardViewModelBase with Store {
wow.wownero!.getCurrentAccount(wallet).id)
.toList();

transactions = ObservableList.of(
transactions.addAll(
_accountTransactions.map(
(transaction) => TransactionListItem(
transaction: transaction,
Expand Down
8 changes: 4 additions & 4 deletions scripts/android/app_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN)
APP_ANDROID_TYPE=$1

MONERO_COM_NAME="Monero.com"
MONERO_COM_VERSION="1.19.0"
MONERO_COM_BUILD_NUMBER=109
MONERO_COM_VERSION="1.19.1"
MONERO_COM_BUILD_NUMBER=110
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.22.0"
CAKEWALLET_BUILD_NUMBER=240
CAKEWALLET_VERSION="4.22.1"
CAKEWALLET_BUILD_NUMBER=241
CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet"
CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet"
CAKEWALLET_SCHEME="cakewallet"
Expand Down
8 changes: 4 additions & 4 deletions scripts/ios/app_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN)
APP_IOS_TYPE=$1

MONERO_COM_NAME="Monero.com"
MONERO_COM_VERSION="1.19.0"
MONERO_COM_BUILD_NUMBER=106
MONERO_COM_VERSION="1.19.1"
MONERO_COM_BUILD_NUMBER=107
MONERO_COM_BUNDLE_ID="com.cakewallet.monero"

CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="4.22.0"
CAKEWALLET_BUILD_NUMBER=287
CAKEWALLET_VERSION="4.22.1"
CAKEWALLET_BUILD_NUMBER=288
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"

HAVEN_NAME="Haven"
Expand Down
4 changes: 2 additions & 2 deletions scripts/linux/app_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ if [ -n "$1" ]; then
fi

CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="1.12.0"
CAKEWALLET_BUILD_NUMBER=41
CAKEWALLET_VERSION="1.12.1"
CAKEWALLET_BUILD_NUMBER=42

if ! [[ " ${TYPES[*]} " =~ " ${APP_LINUX_TYPE} " ]]; then
echo "Wrong app type."
Expand Down
8 changes: 4 additions & 4 deletions scripts/macos/app_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ if [ -n "$1" ]; then
fi

MONERO_COM_NAME="Monero.com"
MONERO_COM_VERSION="1.9.0"
MONERO_COM_BUILD_NUMBER=39
MONERO_COM_VERSION="1.9.1"
MONERO_COM_BUILD_NUMBER=40
MONERO_COM_BUNDLE_ID="com.cakewallet.monero"

CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="1.15.0"
CAKEWALLET_BUILD_NUMBER=99
CAKEWALLET_VERSION="1.15.1"
CAKEWALLET_BUILD_NUMBER=100
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"

if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/windows/build_exe_installer.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MyAppName "Cake Wallet"
#define MyAppVersion "0.3.0"
#define MyAppVersion "0.3.1"
#define MyAppPublisher "Cake Labs LLC"
#define MyAppURL "https://cakewallet.com/"
#define MyAppExeName "CakeWallet.exe"
Expand Down

0 comments on commit d1c45a5

Please sign in to comment.