What changed, and why it matters
This commit only adds Dart 'const' constructors to a few internal interface classes and changes their instantiation sites to use 'const'. It is a code-quality/performance micro-optimization with no visible security relevance.
No security action required. Treat as a normal refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds const constructors to CsSalviumInterface, _LibSparkInterfaceImpl, _FrostInterfaceImpl, and _CsSalviumInterfaceImpl, and updates _getInterface() callers to use const instances. These are compile-time constant object optimizations in Dart. No logic, behavior, input handling, cryptography, or access control changes are present.
Changed components
lib/wl_gen/interfaces/cs_salvium_interface.darttool/wl_templates/FIRO_lib_spark_interface_impl.template.darttool/wl_templates/FROST_frost_interface_impl.template.darttool/wl_templates/SAL_cs_salvium_interface_impl.template.dartInspect captured patch +11 / −3
diff --git a/lib/wl_gen/interfaces/cs_salvium_interface.dart b/lib/wl_gen/interfaces/cs_salvium_interface.dart
index 0b7a509..3ed43f7 100644
--- a/lib/wl_gen/interfaces/cs_salvium_interface.dart
+++ b/lib/wl_gen/interfaces/cs_salvium_interface.dart
@@ -4,6 +4,8 @@ import 'cs_monero_interface.dart';
export '../generated/cs_salvium_interface_impl.dart';
abstract class CsSalviumInterface {
+ const CsSalviumInterface();
+
void setUseCsSalviumLoggerInternal(bool enable);
// tx prio forwarding
diff --git a/tool/wl_templates/FIRO_lib_spark_interface_impl.template.dart b/tool/wl_templates/FIRO_lib_spark_interface_impl.template.dart
index 2403a81..0842a48 100644
--- a/tool/wl_templates/FIRO_lib_spark_interface_impl.template.dart
+++ b/tool/wl_templates/FIRO_lib_spark_interface_impl.template.dart
@@ -18,12 +18,14 @@ List<String> hashTags({required List<String> base64Tags}) =>
//END_OFF
//ON
-LibSparkInterface _getInterface() => _LibSparkInterfaceImpl();
+LibSparkInterface _getInterface() => const _LibSparkInterfaceImpl();
List<String> hashTags({required List<String> base64Tags}) =>
LibSpark.hashTags(base64Tags: base64Tags);
class _LibSparkInterfaceImpl extends LibSparkInterface {
+ const _LibSparkInterfaceImpl();
+
@override
String get sparkBaseDerivationPath => kSparkBaseDerivationPath;
diff --git a/tool/wl_templates/FROST_frost_interface_impl.template.dart b/tool/wl_templates/FROST_frost_interface_impl.template.dart
index 072af51..e26d966 100644
--- a/tool/wl_templates/FROST_frost_interface_impl.template.dart
+++ b/tool/wl_templates/FROST_frost_interface_impl.template.dart
@@ -24,9 +24,11 @@ FrostInterface _getInterface() => throw Exception("FROST not enabled!");
//END_OFF
//ON
-FrostInterface _getInterface() => _FrostInterfaceImpl();
+FrostInterface _getInterface() => const _FrostInterfaceImpl();
final class _FrostInterfaceImpl extends FrostInterface {
+ const _FrostInterfaceImpl();
+
@override
({OpaqueWrapper machinePtr, String preprocess}) attemptSignConfig({
required int network,
diff --git a/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart
index b3e88da..d86c41e 100644
--- a/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart
+++ b/tool/wl_templates/SAL_cs_salvium_interface_impl.template.dart
@@ -17,13 +17,15 @@ CsSalviumInterface _getInterface() => throw Exception("XMR/WOW not enabled!");
//END_OFF
//ON
-CsSalviumInterface _getInterface() => _CsSalviumInterfaceImpl();
+CsSalviumInterface _getInterface() => const _CsSalviumInterfaceImpl();
extension _WrappedWalletExt on WrappedWallet {
lib_salvium.SalviumWallet get actual => get();
}
class _CsSalviumInterfaceImpl extends CsSalviumInterface {
+ const _CsSalviumInterfaceImpl();
+
@override
void setUseCsSalviumLoggerInternal(bool enable) =>
lib_salvium.Logging.useLogger = enable;
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.