What changed, and why it matters
This commit adds a new automated test to verify that a checksum function correctly handles non-ASCII characters (like accented letters, Chinese, Japanese, Arabic, and Hebrew text). It does not change any production code. The test ensures that special characters are kept as-is rather than being converted to Unicode escape sequences before hashing. This is a quality-assurance change, not a security fix or vulnerability.
No action required. This is a test-only addition. If reviewing the related plugin, verify that `_checksum` uses `ensure_ascii=False` consistently to avoid checksum mismatches for wallets with non-ASCII names.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds test_checksum_non_ascii to tests/test_timelock_recovery.py. It imports Plugin from the timelock_recovery QT plugin and calls its _checksum static/class method with a JSON object containing a variety of non-ASCII characters. The test asserts that the resulting checksum equals 74674eca. The comment indicates the intent is to ensure ensure_ascii=False is used during JSON serialization before hashing. No production code is modified.
Changed components
tests/test_timelock_recovery.pyelectrum/plugins/timelock_recovery/qt.py (referenced by test only, not modified)Inspect captured patch +8 / −0
diff --git a/tests/test_timelock_recovery.py b/tests/test_timelock_recovery.py
index 1df32e6..efe21e3 100644
--- a/tests/test_timelock_recovery.py
+++ b/tests/test_timelock_recovery.py
@@ -9,6 +9,7 @@ from electrum.storage import WalletStorage
from electrum.transaction import PartialTxOutput
from electrum.wallet import Wallet
from electrum.wallet_db import WalletDB
+from electrum.plugins.timelock_recovery.qt import Plugin as TimelockRecoveryQtPlugin
from . import ElectrumTestCase
@@ -119,3 +120,10 @@ class TestTimelockRecovery(ElectrumTestCase):
self.assertEqual(cancellation_tx_outputs, [
('tb1q6k5h4cz6ra8nzhg90xm9wldvadgh0fpttfthcg', 737065),
])
+
+ def test_checksum_non_ascii(self):
+ # Non-ASCII characters must be serialized as-is (ensure_ascii=False),
+ # not escaped as \uXXXX sequences, before hashing.
+ json_data = {"wallet_name": "Ωmega Wörld Ñoño 日本語 中文 עברית العربية", "id": "abc-123"}
+ result = TimelockRecoveryQtPlugin._checksum(json_data)
+ self.assertEqual(result, "74674eca")
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.