Skip to content

Conversation

@LexxXell
Copy link

Refactor: modernize and unify __str__ methods across transaction classes

This PR updates the __str__ implementations for several transaction-related classes to improve readability, consistency, and maintainability while preserving exact output semantics.

Summary of changes

  • Replaced old % formatting with f-strings for clarity and modern Python style.
  • Preserved all original field order, line breaks, and output format to avoid breaking GUI or existing log parsers.
  • Kept binary-to-hex conversions (bh2u) exactly as before where originally present.
  • Removed outdated formatting artifacts (typos such as sequeence).
  • Ensured that no functional logic or serialization behavior is modified — only string representation.

Affected components

  • CTxIn
  • CTxOut
  • ProRegTx
  • ProUpRegTx
  • ProUpRevTx
  • CbTx
  • AssetLockTx
  • AssetUnlockTx

Why this change

The original __str__ implementations were inconsistent in style and used legacy formatting.
This cleanup makes the codebase more uniform and maintainable while ensuring output remains fully backward-compatible.

Compatibility

✔ No behavior changes
✔ No serialization logic changes
✔ Output format preserved
✔ Safe for all downstream consumers (GUI/logs/tests)

@pshenmic pshenmic merged commit 7c3f320 into pshenmic:develop Nov 14, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants