-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add tx hex to stdout #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… update transaction structure
… update transaction structure for error handling
…ks and assertions
…update assertions
…for broadcast error handling
…nhance error handling assertions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds transaction hex output to stdout by refactoring the transaction publishing flow. The main change separates Safe transaction building from sending, enabling both dry-run and broadcast modes to output the transaction hex.
- Refactored
send_to_safefunction into separatebuild_safe_transactionandsend_to_safefunctions - Updated
publish_to_stdoutto include Safe transaction hex in JSON output - Modified all related tests to handle the new function signatures and behaviors
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/tq_oracle/report/publisher.py | Split send_to_safe into build_safe_transaction and send_to_safe, updated publish_to_stdout to include tx hex |
| tests/report/test_publisher.py | Added fixture for SafeTx, updated all tests to match new function signatures and verify tx hex output |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return SafeTx( | ||
| ethereum_client=ethereum_client, | ||
| safe_address=safe_address, | ||
| to=Web3.to_checksum_address("0x4234567890123456789012345678901234567890"), |
Copilot
AI
Oct 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This hardcoded address should be extracted as a constant or use a more descriptive test address to improve maintainability and readability.
| "0x0000000000000000000000000000000000000000" | ||
| ), | ||
| refund_receiver=Web3.to_checksum_address( | ||
| "0x0000000000000000000000000000000000000000" |
Copilot
AI
Oct 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider using Web3.constants.ADDRESS_ZERO or a named constant instead of hardcoded zero addresses for better readability.
| "0x0000000000000000000000000000000000000000" | |
| ), | |
| refund_receiver=Web3.to_checksum_address( | |
| "0x0000000000000000000000000000000000000000" | |
| Web3.constants.ADDRESS_ZERO | |
| ), | |
| refund_receiver=Web3.to_checksum_address( | |
| Web3.constants.ADDRESS_ZERO |
|
Closed in favor of #59 |
Closes #46