Skip to content

Commit cc7d9a8

Browse files
committed
feat: support selecting node account ID for execution flow
Signed-off-by: Angelina <aceppaluni@gmail.com>
1 parent e83e701 commit cc7d9a8

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/hiero_sdk_python/executable.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,15 @@ def _execute(self, client: "Client"):
176176
if attempt > 0 and current_backoff < self._max_backoff:
177177
current_backoff *= 2
178178

179-
# Set the node account id to the client's node account id
180-
node = client.network.current_node
181-
self.node_account_id = node._account_id
182-
179+
# Select preferred node if provided, fallback to client's default
180+
selected_node_account_id = (
181+
self._select_node_account_id()
182+
or client.network.current_node._account_id
183+
)
184+
185+
self.node_account_id = selected_node_account_id
186+
node = client.network._get_node(self.node_account_id)
187+
183188
# Create a channel wrapper from the client's channel
184189
channel = node._get_channel()
185190

src/hiero_sdk_python/query/query.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,4 +421,5 @@ def _select_node_account_id(self) -> Optional[AccountId]:
421421
selected = self.node_account_ids[0]
422422
self._used_node_account_id = selected
423423
return selected
424-
return None
424+
return None
425+

0 commit comments

Comments
 (0)