Skip to content

Conversation

@AntonioCeppellini
Copy link
Member

@AntonioCeppellini AntonioCeppellini commented Feb 5, 2026

Description:
This PR updates TransactionResponse.get_receipt() adding set_node_account_ids([self.node_id]) to the query chain

we now

  • Pin receipt queries to the submitting node (self.node_id)
  • Have a new dedicated test file
  • Follow other SDKs pattern

Related issue(s):

Fixes #1686

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com>
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

Hi, this is MergeConflictBot.
Your pull request cannot be merged because it contains merge conflicts.

Please resolve these conflicts locally and push the changes.

Quick Fix for CHANGELOG.md Conflicts

If your conflict is only in CHANGELOG.md, you can resolve it easily using the GitHub web editor:

  1. Click on the "Resolve conflicts" button in the PR
  2. Accept both changes (keep both changelog entries)
  3. Click "Mark as resolved"
  4. Commit the merge

For all other merge conflicts, please read:

Thank you for contributing!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

Walkthrough

Pins receipt queries in TransactionResponse.get_receipt() to the submitting node by calling .set_node_account_ids([self.node_id]) on the TransactionGetReceiptQuery. Adds unit tests verifying pinning behavior with mocked node responses and updates CHANGELOG.md entries.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Updated Unreleased/Changed entries: re-added grpc_deadline and type-hint entries; added entry describing receipt queries pinned to submitting node.
Receipt Query Pinning
src/hiero_sdk_python/transaction/transaction_response.py
Modified TransactionResponse.get_receipt() to call .set_node_account_ids([self.node_id]) on the TransactionGetReceiptQuery before .execute(client).
Receipt Pinning Tests
tests/unit/test_transaction_response.py
New unit tests for TransactionResponse validating public attributes and that get_receipt() pins the receipt query to the submitting node using mocked node responses.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client
    participant TxResponse as TransactionResponse
    participant ReceiptQ as TransactionGetReceiptQuery
    participant NodeA as "Node 0.0.3"
    participant NodeB as "Node 0.0.4"

    Client->>TxResponse: response.get_receipt(client)
    TxResponse->>ReceiptQ: new TransactionGetReceiptQuery()
    ReceiptQ->>ReceiptQ: .set_transaction_id(txId)
    ReceiptQ->>ReceiptQ: .set_node_account_ids([submittingNode])
    ReceiptQ->>NodeA: execute(query) 
    alt NodeA returns non-retryable error
        NodeA-->>ReceiptQ: error
        ReceiptQ-->>Client: error
    else NodeA returns SUCCESS
        NodeA-->>ReceiptQ: receipt SUCCESS
        ReceiptQ-->>Client: receipt SUCCESS
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding set_node_account_ids to the query chain, which is the core objective of pinning receipt queries to the submitting node.
Description check ✅ Passed The description is related to the changeset, explaining the purpose of pinning receipt queries to the submitting node and referencing the linked issue #1686.
Linked Issues check ✅ Passed The PR successfully implements the primary objective from #1686: pinning receipt queries to the submitting node by calling set_node_account_ids([self.node_id]) in TransactionResponse.get_receipt(), includes tests validating the pinning behavior, and updates the changelog.
Out of Scope Changes check ✅ Passed All changes are directly related to #1686: updating get_receipt() to pin to submitting node, adding unit tests for the new behavior, and updating CHANGELOG.md. No extraneous modifications detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

assert hasattr(resp, 'transaction'), "Missing public attribute: transaction"

# Assert default values
assert resp.hash == bytes(), "Default hash should be empty bytes"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Use b"" literal instead of bytes() call.

Per static analysis (ruff UP018), bytes() is an unnecessary call that can be replaced with the more idiomatic b"" literal.

♻️ Proposed fix
-    assert resp.hash == bytes(), "Default hash should be empty bytes"
+    assert resp.hash == b"", "Default hash should be empty bytes"
🧰 Tools
🪛 Ruff (0.14.14)

[warning] 34-34: Unnecessary bytes call (rewrite as a literal)

Replace with bytes literal

(UP018)

@exploreriii exploreriii requested a review from a team February 6, 2026 13:57
@exploreriii exploreriii added the status: needs triage review PR needs a review from the triage team label Feb 6, 2026
Copy link
Contributor

@tech0priyanshu tech0priyanshu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hii @AntonioCeppellini great work done ... lgtm

@tech0priyanshu
Copy link
Contributor

some merge conflict @AntonioCeppellini

@tech0priyanshu tech0priyanshu added status: needs developer revision PR has requested changes that the developer needs to implement and removed status: needs triage review PR needs a review from the triage team labels Feb 7, 2026
@exploreriii exploreriii added the status: needs committer review PR needs a review from the committer team label Feb 7, 2026
manishdait
manishdait previously approved these changes Feb 8, 2026
Copy link
Contributor

@manishdait manishdait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just needs a rebase

@manishdait manishdait removed the status: needs developer revision PR has requested changes that the developer needs to implement label Feb 8, 2026
…g-node-by-default

Signed-off-by: AntonioCeppellini <128388022+AntonioCeppellini@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1727   +/-   ##
=======================================
  Coverage   93.28%   93.28%           
=======================================
  Files         141      141           
  Lines        9100     9100           
=======================================
  Hits         8489     8489           
  Misses        611      611           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

manishdait
manishdait previously approved these changes Feb 9, 2026
@exploreriii exploreriii added status: needs developer revision PR has requested changes that the developer needs to implement status: awaiting merge and removed status: needs committer review PR needs a review from the committer team labels Feb 9, 2026
@exploreriii
Copy link
Contributor

just chagelog entry please

Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com>
Copy link
Contributor

@aceppaluni aceppaluni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AntonioCeppellini Great work!

Once rebased, happy to approve and merge!

Copy link
Contributor

@MonaaEid MonaaEid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be implemented as well? ...debatable

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: awaiting merge status: needs developer revision PR has requested changes that the developer needs to implement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Intermediate]: Pin receipt/record queries to submitting node by default

6 participants