Skip to content

Conversation

@matias-gonz
Copy link
Member

@matias-gonz matias-gonz commented Oct 30, 2025

Closes #46

Copilot AI review requested due to automatic review settings October 30, 2025 18:24
Copy link
Contributor

Copilot AI left a 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_safe function into separate build_safe_transaction and send_to_safe functions
  • Updated publish_to_stdout to 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"),
Copy link

Copilot AI Oct 30, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +71
"0x0000000000000000000000000000000000000000"
),
refund_receiver=Web3.to_checksum_address(
"0x0000000000000000000000000000000000000000"
Copy link

Copilot AI Oct 30, 2025

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.

Suggested change
"0x0000000000000000000000000000000000000000"
),
refund_receiver=Web3.to_checksum_address(
"0x0000000000000000000000000000000000000000"
Web3.constants.ADDRESS_ZERO
),
refund_receiver=Web3.to_checksum_address(
Web3.constants.ADDRESS_ZERO

Copilot uses AI. Check for mistakes.
@matias-gonz
Copy link
Member Author

Closed in favor of #59

@matias-gonz matias-gonz deleted the feat/add-tx-hex-to-stdout branch October 30, 2025 20:28
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.

add encoded function data to dry run

2 participants