Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

just comparing changes #2048

Open
wants to merge 23 commits into
base: mweb-bg-sync-3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6c04666
Merge branch 'main' into CW-909-monero-background-sync-investigation
MrCyjaneK Feb 21, 2025
fcc2769
Enhance background sync and wallet initialization across multiple wal…
MrCyjaneK Feb 20, 2025
dc04009
fix generated code, fix zano, update monero_c
MrCyjaneK Feb 21, 2025
1493dd4
[skip slack] remove print statement
MrCyjaneK Feb 21, 2025
1287a31
Clear status code to prevent errors during bg sync
MrCyjaneK Feb 21, 2025
8c02973
[skip-ci] merge main
fossephate Feb 22, 2025
025f7a9
don't create subaddresses on out of bounds accounts
MrCyjaneK Feb 24, 2025
74b0076
don't stop wallet when coming back to the foreground
fossephate Feb 24, 2025
900475f
final fix for background sync
MrCyjaneK Feb 24, 2025
d1de481
Update PIN page (#2051)
tuxpizza Feb 24, 2025
465ff7e
feat: Add app-version to Chatwoot Contact Attributes (#2049)
konstantinullrich Feb 24, 2025
67f0a46
Update strings_it.arb (#2046)
saloniamatteo Feb 24, 2025
81ca388
fix fiat amount on token change (#2042)
Serhii-Borodenko Feb 25, 2025
cfbf1f7
Merge branch 'main' into CW-909-monero-background-sync-investigation
OmarHatem28 Feb 25, 2025
1f08596
Update dfx subdomain (#2053)
TaprootFreak Feb 26, 2025
3a56277
Minor locale change [skip ci]
OmarHatem28 Feb 27, 2025
57fe328
Cw 939 whitelist known tokens (#2038)
fossephate Feb 27, 2025
fd4254d
Add unstoppable domains
OmarHatem28 Feb 28, 2025
feeba34
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
fossephate Feb 28, 2025
c7a2388
Update lib/di.dart
fossephate Mar 2, 2025
6112d49
remove unnecessary timeout
fossephate Mar 2, 2025
cf91996
Update cw_zano/lib/zano_wallet.dart
fossephate Mar 2, 2025
a6d16bb
enable debug screen only in debug
MrCyjaneK Mar 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/automated_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ jobs:
echo "const cakePayApiKey = '${{ secrets.CAKE_PAY_API_KEY }}';" >> lib/.secrets.g.dart
echo "const authorization = '${{ secrets.CAKE_PAY_AUTHORIZATION }}';" >> lib/.secrets.g.dart
echo "const CSRFToken = '${{ secrets.CSRF_TOKEN }}';" >> lib/.secrets.g.dart
echo "const quantexExchangeMarkup = '${{ secrets.QUANTEX_EXCHANGE_MARKUP }}';" >> lib/.secrets.g.dart
echo "const swapTradeExchangeMarkup = '${{ secrets.SWAPTRADE_EXCHANGE_MARKUP }}';" >> lib/.secrets.g.dart
echo "const nano2ApiKey = '${{ secrets.NANO2_API_KEY }}';" >> cw_nano/lib/.secrets.g.dart
echo "const nanoNowNodesApiKey = '${{ secrets.NANO_NOW_NODES_API_KEY }}';" >> cw_nano/lib/.secrets.g.dart
echo "const tronGridApiKey = '${{ secrets.TRON_GRID_API_KEY }}';" >> cw_tron/lib/.secrets.g.dart
Expand Down
25 changes: 18 additions & 7 deletions .github/workflows/pr_test_build_android.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Cake Wallet Android

on: [push]
on: [pull_request]

defaults:
run:
Expand Down Expand Up @@ -34,10 +34,19 @@ jobs:
- name: Fix github actions messing up $HOME...
run: 'echo HOME=/root | sudo tee -a $GITHUB_ENV'
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: configure git
run: |
git config --global --add safe.directory '*'
git config --global user.email "[email protected]"
git config --global user.name "CakeWallet CI"
- name: Get the full commit message
run: |
FULL_MESSAGE="$(git log -1 --pretty=%B)"
echo "message<<EOF" >> $GITHUB_ENV
echo "$FULL_MESSAGE" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Add secrets
run: |
touch lib/.secrets.g.dart
Expand Down Expand Up @@ -126,7 +135,7 @@ jobs:
echo "const cakePayApiKey = '${{ secrets.CAKE_PAY_API_KEY }}';" >> lib/.secrets.g.dart
echo "const authorization = '${{ secrets.CAKE_PAY_AUTHORIZATION }}';" >> lib/.secrets.g.dart
echo "const CSRFToken = '${{ secrets.CSRF_TOKEN }}';" >> lib/.secrets.g.dart
echo "const quantexExchangeMarkup = '${{ secrets.QUANTEX_EXCHANGE_MARKUP }}';" >> lib/.secrets.g.dart
echo "const swapTradeExchangeMarkup = '${{ secrets.SWAPTRADE_EXCHANGE_MARKUP }}';" >> lib/.secrets.g.dart
echo "const nano2ApiKey = '${{ secrets.NANO2_API_KEY }}';" >> cw_nano/lib/.secrets.g.dart
echo "const nanoNowNodesApiKey = '${{ secrets.NANO_NOW_NODES_API_KEY }}';" >> cw_nano/lib/.secrets.g.dart
echo "const tronGridApiKey = '${{ secrets.TRON_GRID_API_KEY }}';" >> cw_tron/lib/.secrets.g.dart
Expand Down Expand Up @@ -160,6 +169,10 @@ jobs:
echo "const nanoTestWalletReceiveAddress = '${{ secrets.NANO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
echo "const wowneroTestWalletReceiveAddress = '${{ secrets.WOWNERO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
echo "const moneroTestWalletBlockHeight = '${{ secrets.MONERO_TEST_WALLET_BLOCK_HEIGHT }}';" >> lib/.secrets.g.dart
# end of test secrets
echo "const chainflipApiKey = '${{ secrets.CHAINFLIP_API_KEY }}';" >> lib/.secrets.g.dart
echo "const chainflipAffiliateFee = '${{ secrets.CHAINFLIP_AFFILIATE_FEE }}';" >> lib/.secrets.g.dart

- name: prepare monero_c and cache
run: |
export MONEROC_HASH=$(cat scripts/prepare_moneroc.sh | grep 'git checkout' | xargs | awk '{ print $3 }')
Expand Down Expand Up @@ -259,25 +272,23 @@ jobs:
mkdir test-apk
cp app-arm64-v8a-release.apk test-apk/${BRANCH_NAME}.apk
cp app-x86_64-release.apk test-apk/${BRANCH_NAME}_x86.apk
cd test-apk
cp ${BRANCH_NAME}.apk ${BRANCH_NAME}_slack.apk

- name: Find APK file
id: find_apk
run: |
set -x
apk_file=$(ls build/app/outputs/flutter-apk/test-apk/*_slack.apk || exit 1)
apk_file=$(ls build/app/outputs/flutter-apk/test-apk/${BRANCH_NAME}.apk || exit 1)
echo "APK_FILE=$apk_file" >> $GITHUB_ENV

- name: Upload artifact to slack
if: ${{ !contains(github.event.head_commit.message, 'skip slack') }}
if: ${{ !contains(env.message, 'skip slack') }}
continue-on-error: true
uses: adrey/[email protected]
with:
token: ${{ secrets.SLACK_APP_TOKEN }}
path: ${{ env.APK_FILE }}
channel: ${{ secrets.SLACK_APK_CHANNEL }}
initial_comment: ${{ github.event.head_commit.message }}
initial_comment: ${{ env.message }}

- name: cleanup
run: rm -rf build/app/outputs/flutter-apk/test-apk/
Expand Down
29 changes: 21 additions & 8 deletions .github/workflows/pr_test_build_linux.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Cake Wallet Linux

on: [push]
on: [pull_request]

defaults:
run:
Expand Down Expand Up @@ -30,10 +30,19 @@ jobs:
- name: Fix github actions messing up $HOME...
run: 'echo HOME=/root | sudo tee -a $GITHUB_ENV'
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: configure git
run: |
git config --global --add safe.directory '*'
git config --global user.email "[email protected]"
git config --global user.name "CakeWallet CI"
- name: Get the full commit message
run: |
FULL_MESSAGE="$(git log -1 --pretty=%B)"
echo "message<<EOF" >> $GITHUB_ENV
echo "$FULL_MESSAGE" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Add secrets
run: |
touch lib/.secrets.g.dart
Expand Down Expand Up @@ -122,7 +131,7 @@ jobs:
echo "const cakePayApiKey = '${{ secrets.CAKE_PAY_API_KEY }}';" >> lib/.secrets.g.dart
echo "const authorization = '${{ secrets.CAKE_PAY_AUTHORIZATION }}';" >> lib/.secrets.g.dart
echo "const CSRFToken = '${{ secrets.CSRF_TOKEN }}';" >> lib/.secrets.g.dart
echo "const quantexExchangeMarkup = '${{ secrets.QUANTEX_EXCHANGE_MARKUP }}';" >> lib/.secrets.g.dart
echo "const swapTradeExchangeMarkup = '${{ secrets.SWAPTRADE_EXCHANGE_MARKUP }}';" >> lib/.secrets.g.dart
echo "const nano2ApiKey = '${{ secrets.NANO2_API_KEY }}';" >> cw_nano/lib/.secrets.g.dart
echo "const nanoNowNodesApiKey = '${{ secrets.NANO_NOW_NODES_API_KEY }}';" >> cw_nano/lib/.secrets.g.dart
echo "const tronGridApiKey = '${{ secrets.TRON_GRID_API_KEY }}';" >> cw_tron/lib/.secrets.g.dart
Expand Down Expand Up @@ -155,7 +164,11 @@ jobs:
echo "const tronTestWalletReceiveAddress = '${{ secrets.TRON_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
echo "const nanoTestWalletReceiveAddress = '${{ secrets.NANO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
echo "const wowneroTestWalletReceiveAddress = '${{ secrets.WOWNERO_TEST_WALLET_RECEIVE_ADDRESS }}';" >> lib/.secrets.g.dart
echo "const moneroTestWalletBlockHeight = '${{ secrets.MONERO_TEST_WALLET_BLOCK_HEIGHT }}';" >> lib/.secrets.g.dart
echo "const moneroTestWalletBlockHeight = '${{ secrets.MONERO_TEST_WALLET_BLOCK_HEIGHT }}';" >> lib/.secrets.g.dart
# end of test secrets
echo "const chainflipApiKey = '${{ secrets.CHAINFLIP_API_KEY }}';" >> lib/.secrets.g.dart
echo "const chainflipAffiliateFee = '${{ secrets.CHAINFLIP_AFFILIATE_FEE }}';" >> lib/.secrets.g.dart

- name: prepare monero_c and cache
run: |
export MONEROC_HASH=$(cat scripts/prepare_moneroc.sh | grep 'git checkout' | xargs | awk '{ print $3 }')
Expand Down Expand Up @@ -227,7 +240,7 @@ jobs:
name: cakewallet_linux

- name: Prepare virtual desktop
if: ${{ contains(github.event.head_commit.message, 'run tests') }}
if: ${{ contains(env.message, 'run tests') }}
run: |
nohup Xvfb :99 -screen 0 720x1280x16 &
echo DISPLAY=:99 | sudo tee -a $GITHUB_ENV
Expand All @@ -243,28 +256,28 @@ jobs:
# isn't much in those wallets anyway, we still wouldn't like to leak it to anyone who is able to access github.

- name: Test [confirm_seeds_flow_test]
if: ${{ contains(github.event.head_commit.message, 'run tests') }}
if: ${{ contains(env.message, 'run tests') }}
timeout-minutes: 20
run: |
xmessage -timeout 30 "confirm_seeds_flow_test" &
rm -rf ~/.local/share/com.example.cake_wallet/ ~/Documents/cake_wallet/ ~/cake_wallet
exec timeout --signal=SIGKILL 900 flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test_suites/confirm_seeds_flow_test.dart
- name: Test [create_wallet_flow_test]
if: ${{ contains(github.event.head_commit.message, 'run tests') }}
if: ${{ contains(env.message, 'run tests') }}
timeout-minutes: 20
run: |
xmessage -timeout 30 "create_wallet_flow_test" &
rm -rf ~/.local/share/com.example.cake_wallet/ ~/Documents/cake_wallet/ ~/cake_wallet
exec timeout --signal=SIGKILL 900 flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test_suites/create_wallet_flow_test.dart
- name: Test [exchange_flow_test]
if: ${{ contains(github.event.head_commit.message, 'run tests') }}
if: ${{ contains(env.message, 'run tests') }}
timeout-minutes: 20
run: |
xmessage -timeout 30 "exchange_flow_test" &
rm -rf ~/.local/share/com.example.cake_wallet/ ~/Documents/cake_wallet/ ~/cake_wallet
exec timeout --signal=SIGKILL 900 flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test_suites/exchange_flow_test.dart
- name: Test [restore_wallet_through_seeds_flow_test]
if: ${{ contains(github.event.head_commit.message, 'run tests') }}
if: ${{ contains(env.message, 'run tests') }}
timeout-minutes: 20
run: |
xmessage -timeout 30 "restore_wallet_through_seeds_flow_test" &
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ cw_shared_external/ios/External/
cw_haven/ios/External/
cw_haven/android/.externalNativeBuild/
cw_haven/android/.cxx/

cw_zano/ios/External/
lib/bitcoin/bitcoin.dart
lib/monero/monero.dart
lib/haven/haven.dart
Expand All @@ -137,6 +137,7 @@ lib/polygon/polygon.dart
lib/solana/solana.dart
lib/tron/tron.dart
lib/wownero/wownero.dart
lib/zano/zano.dart

ios/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_180.png
ios/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_120.png
Expand Down Expand Up @@ -179,3 +180,5 @@ scripts/monero_c
# iOS generated framework bin
ios/MoneroWallet.framework/MoneroWallet
ios/WowneroWallet.framework/WowneroWallet
ios/ZanoWallet.framework/ZanoWallet
*_libwallet2_api_c.dylib
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2023 Cake Labs LLC
Copyright (c) 2018-2025 Cake Labs LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ analyzer:
lib/solana/cw_solana.dart,
lib/tron/cw_tron.dart,
lib/wownero/cw_wownero.dart,
lib/zano/cw_zano.dart,
]
language:
strict-casts: true
Expand Down
6 changes: 6 additions & 0 deletions android/app/src/main/AndroidManifestBase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />


<!-- background sync -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />

<application
android:name=".Application"
android:label="${APP_NAME}"
Expand Down Expand Up @@ -89,6 +92,9 @@
<data android:scheme="wownero" />
<data android:scheme="wownero-wallet" />
<data android:scheme="wownero_wallet" />
<data android:scheme="zano" />
<data android:scheme="zano-wallet" />
<data android:scheme="zano_wallet" />
</intent-filter>
<!-- nano-gpt link scheme -->
<intent-filter android:autoVerify="true">
Expand Down
Binary file added assets/images/chainflip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flip_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added assets/images/zano_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/text/Monerocom_Release_Notes.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Ledger fixes
UI enhancements
Bug fixes
5 changes: 3 additions & 2 deletions assets/text/Release_Notes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Bitcoin and Litecoin enhancements
Solana and Nano fixes/improvements
Zano enhancements
Ethereum enhancements
Ledger fixes
UI enhancements
Bug fixes
7 changes: 7 additions & 0 deletions assets/zano_node_list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-
uri: 37.27.100.59:10500
useSSL: false
-
uri: zano.cakewallet.com:11211
is_default: true
useSSL: false
6 changes: 5 additions & 1 deletion cw_bitcoin/lib/bitcoin_wallet_addresses.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:bitcoin_base/bitcoin_base.dart';
import 'package:blockchain_utils/bip/bip/bip32/bip32.dart';
import 'package:cw_bitcoin/electrum_wallet_addresses.dart';
import 'package:cw_bitcoin/utils.dart';
import 'package:cw_core/unspent_coin_type.dart';
import 'package:cw_core/wallet_info.dart';
import 'package:mobx/mobx.dart';

Expand All @@ -26,7 +27,10 @@ abstract class BitcoinWalletAddressesBase extends ElectrumWalletAddresses with S

@override
String getAddress(
{required int index, required Bip32Slip10Secp256k1 hd, BitcoinAddressType? addressType}) {
{required int index,
required Bip32Slip10Secp256k1 hd,
BitcoinAddressType? addressType,
UnspentCoinType coinTypeToSpendFrom = UnspentCoinType.any}) {
if (addressType == P2pkhAddressType.p2pkh)
return generateP2PKHAddress(hd: hd, index: index, network: network);

Expand Down
10 changes: 1 addition & 9 deletions cw_bitcoin/lib/electrum_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -603,15 +603,6 @@ abstract class ElectrumWalletBase
electrumClient.onConnectionStatusChange = _onConnectionStatusChange;

await electrumClient.connectToUri(node.uri, useSSL: node.useSSL);

int secondsWaited = 0;
while (!electrumClient.isConnected) {
await Future.delayed(const Duration(seconds: 1));
secondsWaited++;
if (secondsWaited > 5) {
break;
}
}
} catch (e, stacktrace) {
printV(stacktrace);
printV("connectToNode $e");
Expand Down Expand Up @@ -865,6 +856,7 @@ abstract class ElectrumWalletBase
final changeAddress = await walletAddresses.getChangeAddress(
inputs: utxoDetails.availableInputs,
outputs: updatedOutputs,
coinTypeToSpendFrom: coinTypeToSpendFrom,
);
final address = RegexUtils.addressTypeFromStr(changeAddress.address, network);
updatedOutputs.add(BitcoinOutput(
Expand Down
19 changes: 11 additions & 8 deletions cw_bitcoin/lib/electrum_wallet_addresses.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:bitcoin_base/bitcoin_base.dart';
import 'package:blockchain_utils/blockchain_utils.dart';
import 'package:cw_bitcoin/bitcoin_address_record.dart';
import 'package:cw_bitcoin/electrum_wallet.dart';
import 'package:cw_core/unspent_coin_type.dart';
import 'package:cw_core/utils/print_verbose.dart';
import 'package:cw_bitcoin/bitcoin_unspent.dart';
import 'package:cw_core/wallet_addresses.dart';
Expand Down Expand Up @@ -47,7 +48,6 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
List<BitcoinAddressRecord>? initialMwebAddresses,
Bip32Slip10Secp256k1? masterHd,
BitcoinAddressType? initialAddressPageType,

}) : _addresses = ObservableList<BitcoinAddressRecord>.of((initialAddresses ?? []).toSet()),
addressesByReceiveType =
ObservableList<BaseBitcoinAddressRecord>.of((<BitcoinAddressRecord>[]).toSet()),
Expand Down Expand Up @@ -187,13 +187,13 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
return;
}
try {
final addressRecord = _addresses.firstWhere(
(addressRecord) => addressRecord.address == addr,
);
final addressRecord = _addresses.firstWhere(
(addressRecord) => addressRecord.address == addr,
);

previousAddressRecord = addressRecord;
receiveAddresses.remove(addressRecord);
receiveAddresses.insert(0, addressRecord);
previousAddressRecord = addressRecord;
receiveAddresses.remove(addressRecord);
receiveAddresses.insert(0, addressRecord);
} catch (e) {
printV("ElectrumWalletAddressBase: set address ($addr): $e");
}
Expand Down Expand Up @@ -274,7 +274,10 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
}

@action
Future<BitcoinAddressRecord> getChangeAddress({List<BitcoinUnspent>? inputs, List<BitcoinOutput>? outputs, bool isPegIn = false}) async {
Future<BitcoinAddressRecord> getChangeAddress(
{List<BitcoinUnspent>? inputs,
List<BitcoinOutput>? outputs,
UnspentCoinType coinTypeToSpendFrom = UnspentCoinType.any}) async {
updateChangeAddresses();

if (changeAddresses.isEmpty) {
Expand Down
Loading
Loading