Skip to content

Commit 463b248

Browse files
committed
chore: cyvlometic codacy fix
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
1 parent c882d60 commit 463b248

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/hiero_sdk_python/transaction/transaction.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,13 @@ def _resolve_transaction_id(self, client: "Client"):
247247
raise ValueError(
248248
"Transaction ID must be set before freezing. Use freeze_with(client) or set_transaction_id()."
249249
)
250-
250+
251+
def _resolve_node_ids(self, client: "Client"):
252+
if self.node_account_id is None and len(self.node_account_ids) == 0:
253+
if client is None:
254+
raise ValueError(
255+
"Node account ID must be set before freezing. Use freeze_with(client) or manually set node_account_ids."
256+
)
251257

252258
def freeze(self):
253259
"""
@@ -290,12 +296,8 @@ def freeze_with(self, client: "Client"):
290296
self._resolve_transaction_id(client)
291297

292298

293-
if self.node_account_id is None and len(self.node_account_ids) == 0:
294-
if client is None:
295-
raise ValueError(
296-
"Node account ID must be set before freezing. Use freeze_with(client) or manually set node_account_ids."
297-
)
298-
299+
self._resolve_node_ids(client)
300+
299301
# We iterate through every node in the client's network
300302
# For each node, set the node_account_id and build the transaction body
301303
# This allows the transaction to be submitted to any node in the network

0 commit comments

Comments
 (0)