What changed, and why it matters
This commit changes how an Epic Cash cryptocurrency wallet is deleted. Previously, the delete command was called directly on an open wallet object. Now the code first closes the wallet, then calls a static delete method that only needs the wallet's configuration string. This looks like a routine cleanup to avoid deleting a wallet that is still open, which could prevent crashes or incomplete deletion. There is no clear security vulnerability visible in the diff itself.
Review the submodule update in `crypto_plugins/flutter_libepiccash` to confirm whether the native `deleteWallet` implementation safely handles deletion after close and does not leave sensitive wallet data behind. Otherwise, no immediate security action is required.
Security signals we found
Resource lifecycle change: wallet handle is explicitly closed before deletion
API signature change: deleteWallet no longer accepts an active wallet object
Submodule update included without visible diff
Evidence from the diff
The patch refactors Epic Cash wallet deletion. In epiccash_wallet.dart, deleteEpicWallet now checks wallet._wallet != null and calls libEpic.close(...) before libEpic.deleteWallet(config: config). The interface and template are updated so deleteWallet no longer takes a DynamicObject wallet parameter and instead invokes a static EpicWallet.deleteWallet(config: config). The submodule crypto_plugins/flutter_libepiccash is also referenced but its diff is not shown. The change is consistent with ensuring the native wallet handle is closed before the underlying store is removed, reducing the risk of use-after-close or partial deletion states.
Changed components
lib/wallets/wallet/impl/epiccash_wallet.dartlib/wl_gen/interfaces/libepiccash_interface.darttool/wl_templates/EPIC_libepiccash_interface_impl.template.dartcrypto_plugins/flutter_libepiccash (submodule, diff not supplied)Inspect captured patch +6 / −11
diff --git a/lib/wallets/wallet/impl/epiccash_wallet.dart b/lib/wallets/wallet/impl/epiccash_wallet.dart
index 4def973..c7571f5 100644
--- a/lib/wallets/wallet/impl/epiccash_wallet.dart
+++ b/lib/wallets/wallet/impl/epiccash_wallet.dart
@@ -1699,7 +1699,8 @@ Future<String> deleteEpicWallet({
" walletId=${wallet.walletId}";
} else {
try {
- return libEpic.deleteWallet(wallet: wallet._wallet!, config: config);
+ if (wallet._wallet != null) await libEpic.close(wallet: wallet._wallet!);
+ return libEpic.deleteWallet(config: config);
} catch (e, s) {
Logging.instance.e("$e\n$s", error: e, stackTrace: s);
return "deleteEpicWallet(${wallet.walletId}) failed...";
diff --git a/lib/wl_gen/interfaces/libepiccash_interface.dart b/lib/wl_gen/interfaces/libepiccash_interface.dart
index f0402ed..e06e75b 100644
--- a/lib/wl_gen/interfaces/libepiccash_interface.dart
+++ b/lib/wl_gen/interfaces/libepiccash_interface.dart
@@ -117,10 +117,7 @@ abstract class LibEpicCashInterface {
Future<void> close({required DynamicObject wallet});
- Future<String> deleteWallet({
- required DynamicObject wallet,
- required String config,
- });
+ Future<String> deleteWallet({required String config});
void updateEpicboxConfig({
required DynamicObject wallet,
diff --git a/tool/wl_templates/EPIC_libepiccash_interface_impl.template.dart b/tool/wl_templates/EPIC_libepiccash_interface_impl.template.dart
index b3a49c1..d40208c 100644
--- a/tool/wl_templates/EPIC_libepiccash_interface_impl.template.dart
+++ b/tool/wl_templates/EPIC_libepiccash_interface_impl.template.dart
@@ -79,11 +79,8 @@ final class _LibEpicCashInterfaceImpl extends LibEpicCashInterface {
}
@override
- Future<String> deleteWallet({
- required DynamicObject wallet,
- required String config,
- }) {
- return wallet.get<EpicWallet>().deleteWallet(config: config);
+ Future<String> deleteWallet({required String config}) {
+ return EpicWallet.deleteWallet(config: config);
}
@override
Why this scored 15/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.