Skip to content

feat: add set_node_account_ids to the query chain - #1727

Merged
exploreriii merged 5 commits into
hiero-ledger:mainfrom
AntonioCeppellini:1686-pin-receipt-record-queries-to-submitting-node-by-default
Feb 11, 2026
Merged

feat: add set_node_account_ids to the query chain#1727
exploreriii merged 5 commits into
hiero-ledger:mainfrom
AntonioCeppellini:1686-pin-receipt-record-queries-to-submitting-node-by-default

Conversation

@AntonioCeppellini

@AntonioCeppellini AntonioCeppellini commented Feb 5, 2026

Copy link
Copy Markdown
Member

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

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown

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

coderabbitai Bot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

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

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Updated Unreleased/Changed entries to reflect Key equality/hash additions and that receipt queries are pinned to the submitting node; adjusted wording for Key entry.
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
Added tests verifying TransactionResponse public attributes and that get_receipt() pins receipt queries to the submitting node using mocked node responses (one node returns non-retryable error, the submitting node returns SUCCESS).

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 (pinned to submitting node)
    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 accurately describes the main change: adding set_node_account_ids to the query chain in TransactionResponse.get_receipt().
Description check ✅ Passed The description clearly explains the change: pinning receipt queries to the submitting node via set_node_account_ids([self.node_id]), adding tests, and aligning with other SDKs.
Linked Issues check ✅ Passed The PR successfully implements the primary objective from #1686: pinning receipt queries to submitting node via set_node_account_ids([self.node_id]), adds required tests, and includes a changelog entry.
Out of Scope Changes check ✅ Passed All changes are directly related to pinning receipt queries to the submitting node. No unrelated 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

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Comment thread tests/unit/test_transaction_response.py
Comment thread tests/unit/test_transaction_response.py
Comment thread tests/unit/test_transaction_response.py
Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Comment thread tests/unit/test_transaction_response.py
Comment thread src/hiero_sdk_python/transaction/transaction_response.py
Comment thread tests/unit/test_transaction_response.py

@tech0priyanshu tech0priyanshu left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

some merge conflict @AntonioCeppellini

manishdait
manishdait previously approved these changes Feb 8, 2026

@manishdait manishdait left a comment

Copy link
Copy Markdown
Contributor

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

…g-node-by-default

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

codecov Bot commented Feb 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Comment thread CHANGELOG.md Outdated
manishdait
manishdait previously approved these changes Feb 9, 2026
@exploreriii

Copy link
Copy Markdown
Contributor

just chagelog entry please

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

@aceppaluni aceppaluni left a comment

Copy link
Copy Markdown
Contributor

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!

@MonaaEid MonaaEid left a comment

Copy link
Copy Markdown
Contributor

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

…g-node-by-default

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

Copy link
Copy Markdown
Member Author

should this be implemented as well? ...debatable

Image

we could create a dedicated issue to that but i'm open to changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Comment thread CHANGELOG.md
@manishdait

Copy link
Copy Markdown
Contributor

should this be implemented as well? ...debatable
Image

we could create a dedicated issue to that but i'm open to changes

this is address in the PR #1769

@github-actions

Copy link
Copy Markdown

Hello, this is the OfficeHourBot.

This is a reminder that the Hiero Python SDK Office Hours are scheduled in approximately 4 hours (14:00 UTC).

This session provides an opportunity to ask questions regarding this Pull Request.

Details:

Disclaimer: This is an automated reminder. Please verify the schedule here for any changes.

From,
The Python SDK Team

@exploreriii
exploreriii merged commit f154a13 into hiero-ledger:main Feb 11, 2026
19 checks passed
om12prakash pushed a commit to om12prakash/hiero-sdk-python that referenced this pull request Feb 11, 2026
Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com>
Signed-off-by: AntonioCeppellini <128388022+AntonioCeppellini@users.noreply.github.com>
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.

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

6 participants