What changed, and why it matters
This commit only adds a new automated test that checks whether a regular expression correctly accepts or rejects certain Spark Name characters (hyphens/periods vs underscores). It does not change any production wallet code, fix a bug, or alter behavior users would see.
No security action required; treat as routine test coverage. If reviewing broader Spark Name validation, inspect kNameRegexString definition and any callers that construct Spark names.
Security signals we found
No production code changes
Adds test coverage for input validation pattern
Validation concerns Spark Name format, not cryptographic or transaction logic
Evidence from the diff
The diff adds one unit test in test/wallets/spark_name_fee_test.dart. The test imports flutter_libsparkmobile, constructs a RegExp from kNameRegexString, asserts that ‘NAME-FOR.TESTING’ matches and ‘NAME_FOR_TESTING’ does not. No implementation code is modified.
Changed components
test/wallets/spark_name_fee_test.dartInspect captured patch +7 / −0
diff --git a/test/wallets/spark_name_fee_test.dart b/test/wallets/spark_name_fee_test.dart
index 745ceff..a15ed3f 100644
--- a/test/wallets/spark_name_fee_test.dart
+++ b/test/wallets/spark_name_fee_test.dart
@@ -1,9 +1,16 @@
import 'dart:typed_data';
+import 'package:flutter_libsparkmobile/flutter_libsparkmobile.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart';
void main() {
+ test('Spark Name validation rejects underscores before construction', () {
+ final pattern = RegExp(kNameRegexString);
+ expect(pattern.hasMatch('NAME-FOR.TESTING'), isTrue);
+ expect(pattern.hasMatch('NAME_FOR_TESTING'), isFalse);
+ });
+
test('Spark Name fee output includes the name and address tag', () {
final baseScript = Uint8List(25);
final feeScript = sparkNameFeeScript(
Why this scored 12/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.