test: Remove fixed TODO in address_to_scriptpubkey
What changed, and why it matters
This is a tiny test-only code cleanup. It removes a completed TODO comment and changes an internal assertion failure into a more descriptive error message when an unsupported address type is encountered in the test framework. It does not affect live Bitcoin Core software, wallets, consensus, networking, or any user-facing behavior.
No security action needed. This is a routine test-framework cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In test/functional/test_framework/address.py, the address_to_scriptpubkey helper is updated to raise ValueError with a clear message instead of using ‘assert False’ when an unsupported address version is supplied. A TODO comment noting future support for other address formats is removed because the current implementation is considered sufficient. The change is purely within the functional test framework and has no production code path.
Changed components
test/functional/test_framework/address.pyInspect captured patch +1 / −3
diff --git a/test/functional/test_framework/address.py b/test/functional/test_framework/address.py
index 2af5cf51..0f7de20b 100644
--- a/test/functional/test_framework/address.py
+++ b/test/functional/test_framework/address.py
@@ -193,9 +193,7 @@ def address_to_scriptpubkey(address):
return keyhash_to_p2pkh_script(payload)
elif version == 196: # testnet script hash
return scripthash_to_p2sh_script(payload)
- # TODO: also support other address formats
- else:
- assert False
+ raise ValueError(f"Unsupported address type: {address}")
class TestFrameworkScript(unittest.TestCase):
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.