refactor(solana): fold write_tx into build_tx
What changed, and why it matters
This is a minor code cleanup in a test file. A helper function used only by one test function was folded into that function. There is no change to production firmware or to what the test actually checks.
No action required. This is a non-functional test-only refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors core/tests/test_apps.solana.transaction.py by inlining write_tx into build_tx. The resulting build_tx produces identical bytes from identical inputs; only the internal call structure changed. No production code, cryptographic logic, parsing, or test assertions were modified.
Changed components
core/tests/test_apps.solana.transaction.pyInspect captured patch +3 / −13
### core/tests/test_apps.solana.transaction.py
@@ -72,27 +72,17 @@ def write_instruction(w: Writer, instruction: RawInstruction) -> None:
write_compact_bytes(w, data)
-def write_tx(
- w: Writer,
+def build_tx(
header: Header,
accounts: Sequence[AnyBytes],
instructions: Sequence[RawInstruction] = (),
blockhash: AnyBytes = BLOCKHASH,
-) -> None:
+) -> bytes:
+ w = bytearray()
write_tx_header(w, *header)
write_compact_array(w, accounts, write_bytes_unchecked)
write_bytes_unchecked(w, blockhash)
write_compact_array(w, instructions, write_instruction)
-
-
-def build_tx(
- header: Header,
- accounts: Sequence[AnyBytes],
- instructions: Sequence[RawInstruction] = (),
- blockhash: AnyBytes = BLOCKHASH,
-) -> bytes:
- w = bytearray()
- write_tx(w, header, accounts, instructions, blockhash)
return bytes(w)
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.