Skip to content

Conversation

@aceppaluni
Copy link
Contributor

Description:
Add Set_node_account_ids() method to Query and Transaction for retrieving receipts or records.

  • Added methods to both Query and Transaction
  • Added unit test for Query
  • Added unit test for Transaction

Related issue(s):

Fixes #86

Notes for reviewer:
Ran tests for both Query and Transaction

2025-09-08 (2) 2025-09-08

Checklist

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

aceppaluni and others added 21 commits May 22, 2025 10:26
Signed-off-by: Angelina <aceppaluni@gmail.com>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
…xamples

Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
@aceppaluni aceppaluni marked this pull request as ready for review September 9, 2025 14:24
Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

Hi @accepaluni please remember to pre-fix your PR title eg
feat: add set node account id method
additionally, we now have a changelog, which must be updated with each PR

@nadineloepfe
Copy link
Contributor

Hi @aceppaluni,
are you still working on this?
also, would you mind adding a "feat:" in front of your PR title as well as an entry in the CHANGELOG? thanks

@aceppaluni
Copy link
Contributor Author

Hi @nadineloepfe Yes, my apologies.
I have been a bit busier then normal. Of course, will do, thank you!

@aceppaluni aceppaluni changed the title Add set node account id method feat: Add set node account id method Oct 20, 2025
@aceppaluni
Copy link
Contributor Author

aceppaluni commented Nov 19, 2025

@exploreriii I think I have fixed it

self.node_index: int = 0
self.payment_amount: Optional[Hbar] = None

self.node_account_ids: Optional[List[AccountId]] = None
Copy link
Contributor

@nadineloepfe nadineloepfe Nov 25, 2025

Choose a reason for hiding this comment

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

just seen - this is duplicated
there;s another self.node_account_ids on line 57. Please remove!

I've also created a branch here to see if it all works with some minor changes, see here:
https://github.com/hiero-ledger/hiero-sdk-python/pull/853/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed

mostly wanted to fix the weird error in the pipeline, hard to see what's going on

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for taking the time to clean this up and address the CI issues. I’ve reviewed the changes in your branch and they all make sense. Everything looks good from my side.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @aceppaluni
The tests here are still failing, what's the next steps? @nadineloepfe will you be working on the new branch any further, or will @aceppaluni use that for reference to update this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @exploreriii, I’m currently awaiting @nadineloepfe 's guidance on how she’d like to proceed. My understanding is that the branch she created will address the test issue and allow us to finalize this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

@exploreriii @aceppaluni: correct! the branch I've raised is passing, so if you'd like you can take inspiration there, and we can also jump on a call to walk through what has been done and why - bit easier than doing it here in writing :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nadineloepfe @exploreriii : Great! Let me know what days and times work for everyone!
I will be available at certain points today. I will not be available tomorrow. I will be available again on Friday :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @nadineloepfe, @exploreriii
What days and times work best for you this week?

Copy link
Contributor

Choose a reason for hiding this comment

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

I am available most days UTC mornings or early afternoons, as well as late evenings

Copy link
Contributor

Choose a reason for hiding this comment

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

lets sync tonight on the Python call? @exploreriii @aceppaluni

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

Hello, this is the Office Hour Bot.

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 or receive assistance from a maintainer.

Details:

Disclaimer: This is an automated reminder. Please verify the schedule here to be notified of any changes.

aceppaluni added a commit to aceppaluni/hiero-sdk-python that referenced this pull request Dec 3, 2025
…ion flow (hiero-ledger#362)

Signed-off-by: Angelina <aceppaluni@gmail.com>
@aceppaluni aceppaluni force-pushed the AddSetNodeAccountIdMethod branch from f521241 to 9ba013e Compare December 3, 2025 15:23
Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

@aceppaluni please check as your test are failing eg
_________________ test_before_execute_payment_not_required ___________________

query = <hiero_sdk_python.query.account_balance_query.CryptoGetAccountBalanceQuery object at 0x7f2ba8111cd0>
mock_client = <hiero_sdk_python.client.client.Client object at 0x7f2ba8112d50>

def test_before_execute_payment_not_required(query, mock_client):
    """Test _before_execute method setup for query that doesn't require payment"""
    # payment_amount is None, should not set payment_amount
    query._before_execute(mock_client)
  assert query.node_account_ids == mock_client.get_node_account_ids()

E assert [] == [AccountId(sh...alm=0, num=3)]
E
E Right contains one more item: AccountId(shard=0, realm=0, num=3)
E
E Full diff:
E + []
E - [
E - AccountId(shard=0, realm=0, num=3),
E - ]

tests/unit/test_query.py:46: AssertionError
_____________________ test_before_execute_payment_required _____________________

query_requires_payment = <hiero_sdk_python.query.token_info_query.TokenInfoQuery object at 0x7f2ba8559850>
mock_client = <hiero_sdk_python.client.client.Client object at 0x7f2ba8113590>

def test_before_execute_payment_required(query_requires_payment, mock_client):
    """Test _before_execute method setup for query that requires payment"""
    # get_cost() should return Hbar(2)
    mock_get_cost = MagicMock()
    mock_get_cost.return_value = Hbar(2)
    query_requires_payment.get_cost = mock_get_cost

    # payment_amount is None, should set payment_amount to 2 Hbars
    query_requires_payment._before_execute(mock_client)
  assert query_requires_payment.node_account_ids == mock_client.get_node_account_ids()

E assert [] == [AccountId(sh...alm=0, num=3)]
E
E Right contains one more item: AccountId(shard=0, realm=0, num=3)
E
E Full diff:
E + []
E - [
E - AccountId(shard=0, realm=0, num=3),
E - ]

tests/unit/test_query.py:60: AssertionError
=========================== short test summary info ============================
FAILED tests/unit/test_query.py::test_before_execute_payment_not_required - assert [] == [AccountId(sh...alm=0, num=3)]

Right contains one more item: AccountId(shard=0, realm=0, num=3)

Full diff:

  • []
  • [
  • AccountId(shard=0, realm=0, num=3),
    
  • ]
    FAILED tests/unit/test_query.py::test_before_execute_payment_required - assert [] == [AccountId(sh...alm=0, num=3)]

Right contains one more item: AccountId(shard=0, realm=0, num=3)

Full diff:

  • []
  • [
  • AccountId(shard=0, realm=0, num=3),
    
  • ]

aceppaluni and others added 13 commits December 3, 2025 17:53
Signed-off-by: Angelina <aceppaluni@gmail.com>
Signed-off-by: Angelina <aceppaluni@gmail.com>
Signed-off-by: Angelina <aceppaluni@gmail.com>
Signed-off-by: Angelina <aceppaluni@gmail.com>
Signed-off-by: Angelina <aceppaluni@gmail.com>
…election

Signed-off-by: Angelina <aceppaluni@gmail.com>
…ion flow (hiero-ledger#362)

Signed-off-by: Angelina <aceppaluni@gmail.com>
Signed-off-by: Angelina <aceppaluni@gmail.com>
Signed-off-by: Angelina <aceppaluni@gmail.com>
Signed-off-by: Angelina <aceppaluni@gmail.com>
Signed-off-by: Angelina <aceppaluni@gmail.com>
@aceppaluni aceppaluni force-pushed the AddSetNodeAccountIdMethod branch from 9ba013e to a0f96ad Compare December 3, 2025 23:44
@aceppaluni
Copy link
Contributor Author

@exploreriii @nadineloepfe Since the tests were failing I did need to modify test_query.py
After making the modification I ran the failing tests locally and they are passing locally.

@exploreriii
Copy link
Contributor

Please push the new changes if you are happy with them and lets run the tests here 👍

@aceppaluni
Copy link
Contributor Author

@exploreriii I pushed the changes and it corrected those first few failing tests. Seems as though another is failing : test_query_retry_on_busy

@aceppaluni
Copy link
Contributor Author

Hi! @nadineloepfe @exploreriii ,
I did a copy/paste of the test_executable.py method and I cannot get the test_query_retry_busy test to pass.

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

@aceppaluni looking at https://github.com/hiero-ledger/hiero-sdk-python/pull/362/files
it is clear that you've not added the new functionality, please try to copy/paste it again now that a rebase isn't required, it should work easier
There are also errors such as deleted lines from a rebase - sorry!!

@aceppaluni
Copy link
Contributor Author

@exploreriii
Hmm, thats interesting. I wonder if maybe I should have copied more then just query and executable?
And no worries! Rebases are definitely tricky for me.

@exploreriii
Copy link
Contributor

try it again please and see if it works 👍
You can see in /files, query and executable look very different to Nadine's version

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 set_node_account_ids() functionality to track executed node

4 participants