Skip to content

Commit

Permalink
v4.23.0 release candidate (#1974)
Browse files Browse the repository at this point in the history
* v4.23.0 release candidate

* - Fix restoring zano from QR
- Fix Zano confirmations count
- Fix birdpay
- Fix balance display

* Fix Zano assets showing amount before they are added

* - handle fetching token data while the API is busy
- potential fix for duplicate transactions

* fix receive confirmations, maybe

* revert onChangeWallet cleanup

* Fix confirmations not updating

* improve zano wallet opening, fix CI commands and messages on slack (#1979)

Co-authored-by: Omar Hatem <[email protected]>

* Cache wallet when creating/restoring as well

* - hardcode Trocador Maximum limit for Zano temporarily
- Configure Cake Zano node to use SSL

* reformatting [skip ci]

* revert to non-ssl

* update build numbers [skip ci]

* disable zano for desktop [skip ci]

---------

Co-authored-by: cyan <[email protected]>
  • Loading branch information
OmarHatem28 and MrCyjaneK authored Jan 28, 2025
1 parent aef90e7 commit 141a7eb
Show file tree
Hide file tree
Showing 42 changed files with 472 additions and 306 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/pr_test_build_android.yml
Original file line number Diff line number Diff line change
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 @@ -274,14 +283,14 @@ jobs:
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
19 changes: 14 additions & 5 deletions .github/workflows/pr_test_build_linux.yml
Original file line number Diff line number Diff line change
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 @@ -231,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 @@ -247,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
2 changes: 2 additions & 0 deletions assets/text/Monerocom_Release_Notes.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Monero restore with passphrase support
Add Chainflip Exchange provider
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
Add Zano Wallet
Monero/Wownero/Zano restore with passphrase support
Add Chainflip Exchange provider
UI enhancements
Bug fixes
3 changes: 3 additions & 0 deletions assets/zano_node_list.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
-
uri: 37.27.100.59:10500
useSSL: false
-
uri: zano.cakewallet.com:11211
is_default: true
useSSL: false
57 changes: 38 additions & 19 deletions cw_core/lib/node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ class Node extends HiveObject with Keyable {
case WalletType.polygon:
case WalletType.solana:
case WalletType.tron:
return Uri.parse(
"http${isSSL ? "s" : ""}://$uriRaw${path!.startsWith("/") ? path : "/$path"}");
case WalletType.zano:
return Uri.https(uriRaw, '');
return Uri.parse(
"http${isSSL ? "s" : ""}://$uriRaw${path!.startsWith("/") || path!.isEmpty ? path : "/$path"}");
case WalletType.none:
throw Exception('Unexpected type ${type.toString()} for Node uri');
}
Expand Down Expand Up @@ -177,15 +176,40 @@ class Node extends HiveObject with Keyable {
}

Future<bool> requestZanoNode() async {
return requestMoneroNode(methodName: "getinfo");
final path = '/json_rpc';
final rpcUri = isSSL ? Uri.https(uri.authority, path) : Uri.http(uri.authority, path);
final body = {'jsonrpc': '2.0', 'id': '0', 'method': "getinfo"};

try {
final authenticatingClient = HttpClient();
authenticatingClient.badCertificateCallback =
((X509Certificate cert, String host, int port) => true);

final http.Client client = ioc.IOClient(authenticatingClient);

final jsonBody = json.encode(body);

final response = await client.post(
rpcUri,
headers: {'Content-Type': 'application/json'},
body: jsonBody,
);

printV("node check response: ${response.body}");

final resBody = json.decode(response.body) as Map<String, dynamic>;
return resBody['result']['height'] != null;
} catch (e) {
printV("error: $e");
return false;
}
}

Future<bool> requestMoneroNode({String methodName = 'get_info'}) async {
if (useSocksProxy) {
return await requestNodeWithProxy();
}


final path = '/json_rpc';
final rpcUri = isSSL ? Uri.https(uri.authority, path) : Uri.http(uri.authority, path);
final body = {'jsonrpc': '2.0', 'id': '0', 'method': methodName};
Expand All @@ -195,7 +219,6 @@ class Node extends HiveObject with Keyable {
authenticatingClient.badCertificateCallback =
((X509Certificate cert, String host, int port) => true);


final http.Client client = ioc.IOClient(authenticatingClient);

final jsonBody = json.encode(body);
Expand All @@ -209,13 +232,13 @@ class Node extends HiveObject with Keyable {
if (response.statusCode == 401) {
final daemonRpc = DaemonRpc(
rpcUri.toString(),
username: login??'',
password: password??'',
username: login ?? '',
password: password ?? '',
);
final response = await daemonRpc.call('get_info', {});
return !(response['offline'] as bool);
}

printV("node check response: ${response.body}");

if ((response.body.contains("400 Bad Request") // Some other generic error
Expand Down Expand Up @@ -298,10 +321,7 @@ class Node extends HiveObject with Keyable {
try {
final response = await http.post(
uri,
headers: {
"Content-Type": "application/json",
"nano-app": "cake-wallet"
},
headers: {"Content-Type": "application/json", "nano-app": "cake-wallet"},
body: jsonEncode(
{
"action": "account_balance",
Expand Down Expand Up @@ -407,8 +427,7 @@ class DigestAuth {
}

/// Helper to format the nonce count.
String _formatNonceCount(int count) =>
count.toRadixString(16).padLeft(8, '0');
String _formatNonceCount(int count) => count.toRadixString(16).padLeft(8, '0');

/// Compute the MD5 hash of a string.
String md5Hash(String input) {
Expand All @@ -424,8 +443,7 @@ class DaemonRpc {
DaemonRpc(this.rpcUrl, {required this.username, required this.password});

/// Perform a JSON-RPC call with Digest Authentication.
Future<Map<String, dynamic>> call(
String method, Map<String, dynamic> params) async {
Future<Map<String, dynamic>> call(String method, Map<String, dynamic> params) async {
final http.Client client = http.Client();
final DigestAuth digestAuth = DigestAuth(username, password);

Expand Down Expand Up @@ -475,11 +493,12 @@ class DaemonRpc {
throw Exception('RPC call failed: ${authenticatedResponse.body}');
}

final Map<String, dynamic> result = jsonDecode(authenticatedResponse.body) as Map<String, dynamic>;
final Map<String, dynamic> result =
jsonDecode(authenticatedResponse.body) as Map<String, dynamic>;
if (result['error'] != null) {
throw Exception('RPC Error: ${result['error']}');
}

return result['result'] as Map<String, dynamic>;
}
}
}
4 changes: 2 additions & 2 deletions cw_monero/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@ packages:
dependency: "direct main"
description:
path: "impls/monero.dart"
ref: 9526921acb774b523a2e1d9ba9a7b389acfc6b70
resolved-ref: 9526921acb774b523a2e1d9ba9a7b389acfc6b70
ref: "9526921acb774b523a2e1d9ba9a7b389acfc6b70"
resolved-ref: "9526921acb774b523a2e1d9ba9a7b389acfc6b70"
url: "https://github.com/mrcyjanek/monero_c"
source: git
version: "0.0.0"
Expand Down
4 changes: 2 additions & 2 deletions cw_wownero/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,8 @@ packages:
dependency: "direct main"
description:
path: "impls/monero.dart"
ref: 9526921acb774b523a2e1d9ba9a7b389acfc6b70
resolved-ref: 9526921acb774b523a2e1d9ba9a7b389acfc6b70
ref: "9526921acb774b523a2e1d9ba9a7b389acfc6b70"
resolved-ref: "9526921acb774b523a2e1d9ba9a7b389acfc6b70"
url: "https://github.com/mrcyjanek/monero_c"
source: git
version: "0.0.0"
Expand Down
Loading

0 comments on commit 141a7eb

Please sign in to comment.