What changed, and why it matters
This commit is a routine code cleanup for the Xelis cryptocurrency support. It moves the logic that checks whether a Xelis network node is reachable out of a general test file and into a generated interface file, while also fixing a missing import. There is no indication this change fixes a security vulnerability or introduces one; it appears to be a normal refactoring/bug-fix for build or import correctness.
No security action required. Review as normal code maintenance; verify generated code is regenerated from the updated template.
Security signals we found
No changes to authentication, authorization, or cryptographic operations
No new external input parsing beyond existing endpoint string and SSL flag
No changes to logging of sensitive data; logging behavior preserved
No network protocol changes; same SDK call sequence retained
Commit message and diff indicate import/build fix rather than security fix
Evidence from the diff
The patch refactors Xelis daemon connection testing. It removes a direct dependency on xelis_dart_sdk from lib/utilities/test_node_connection.dart and instead delegates to a generated libXelisInterface.testDaemonConnection() method. The interface and its template implementation are updated accordingly. The actual network behavior (connect, getInfo, check height, disconnect, log result) is preserved. The change is consistent with the commit message “fix missed xelis import” and shows no security-relevant modification to trust boundaries, input validation, cryptography, or access control.
Changed components
lib/utilities/test_node_connection.dartlib/wl_gen/interfaces/lib_xelis_interface.darttool/wl_templates/XEL_lib_xelis_interface_impl.template.dartInspect captured patch +25 / −16
diff --git a/lib/utilities/test_node_connection.dart b/lib/utilities/test_node_connection.dart
index b849d2d..c6b5ee0 100644
--- a/lib/utilities/test_node_connection.dart
+++ b/lib/utilities/test_node_connection.dart
@@ -6,7 +6,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:on_chain/ada/ada.dart';
import 'package:socks5_proxy/socks.dart';
-import 'package:xelis_dart_sdk/xelis_dart_sdk.dart' as xelis_sdk;
import '../app_config.dart';
import '../networking/http.dart';
@@ -20,6 +19,7 @@ import '../wallets/crypto_currency/interfaces/electrumx_currency_interface.dart'
import '../wallets/crypto_currency/intermediate/cryptonote_currency.dart';
import '../wallets/crypto_currency/intermediate/nano_currency.dart';
import '../wallets/wallet/impl/solana_wallet.dart';
+import '../wl_gen/interfaces/lib_xelis_interface.dart';
import 'connection_check/electrum_connection_check.dart';
import 'logger.dart';
import 'test_epic_box_connection.dart';
@@ -301,22 +301,11 @@ Future<bool> testNodeConnection({
case Xelis():
try {
- final daemon = xelis_sdk.DaemonClient(
- endPoint: "${formData.host!}:${formData.port!}",
- secureWebSocket: formData.useSSL ?? false,
- timeout: 5000,
- );
- daemon.connect();
-
- final xelis_sdk.GetInfoResult networkInfo = await daemon.getInfo();
- testPassed = networkInfo.height != null;
-
- daemon.disconnect();
-
- Logging.instance.i(
- "Xelis testNodeConnection result: \"${networkInfo.toString()}\"",
+ testPassed = await libXelis.testDaemonConnection(
+ "${formData.host!}:${formData.port!}",
+ formData.useSSL ?? false,
);
- } catch (e, s) {
+ } catch (_) {
testPassed = false;
}
break;
diff --git a/lib/wl_gen/interfaces/lib_xelis_interface.dart b/lib/wl_gen/interfaces/lib_xelis_interface.dart
index 533b90f..1fc28f8 100644
--- a/lib/wl_gen/interfaces/lib_xelis_interface.dart
+++ b/lib/wl_gen/interfaces/lib_xelis_interface.dart
@@ -89,6 +89,8 @@ abstract class LibXelisInterface {
Future<BigInt> getXelisBalanceRaw(String walletId);
Future<bool> hasXelisBalance(String walletId);
+
+ Future<bool> testDaemonConnection(String endPoint, bool useSSL);
}
// =============================================================================
diff --git a/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart b/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart
index 08f1f9b..8115f82 100644
--- a/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart
+++ b/tool/wl_templates/XEL_lib_xelis_interface_impl.template.dart
@@ -329,6 +329,24 @@ final class _MwebdServerInterfaceImpl extends LibXelisInterface {
@override
Future<bool> hasXelisBalance(String walletId) =>
_wallets[walletId]!.hasXelisBalance();
+
+ @override
+ Future<bool> testDaemonConnection(String endPoint, bool useSSL) async {
+ final daemon = xelis_sdk.DaemonClient(
+ endPoint: endPoint,
+ secureWebSocket: useSSL,
+ timeout: 5000,
+ );
+ daemon.connect();
+ final xelis_sdk.GetInfoResult networkInfo = await daemon.getInfo();
+ daemon.disconnect();
+
+ Logging.instance.i(
+ "Xelis testNodeConnection result: \"${networkInfo.toString()}\"",
+ );
+
+ return networkInfo.height != null;
+ }
}
extension _XelisNetworkConversion on CryptoCurrencyNetwork {
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.