File tree Expand file tree Collapse file tree 4 files changed +13
-11
lines changed
Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -350,7 +350,7 @@ class ResponseCode(IntEnum):
350350 MAX_CUSTOM_FEES_IS_NOT_SUPPORTED = 387
351351
352352 @classmethod
353- def _missing_ (cls ,value ) :
353+ def _missing_ (cls ,value : int ) -> "ResponseCode" :
354354 """
355355 Handles cases where an integer value does not match any ResponseCode member
356356 and returns 'UNKNOWN_CODE_<value>'.
@@ -361,7 +361,7 @@ def _missing_(cls,value):
361361 return unknown
362362
363363 @classmethod
364- def get_name (cls ,code ) :
364+ def get_name (cls ,code : int ) -> str :
365365 """
366366 Returns the name of the response code.
367367 """
Original file line number Diff line number Diff line change @@ -24,13 +24,13 @@ class TransactionRecord:
2424 transfers : defaultdict [AccountId , int ] = field (default_factory = lambda : defaultdict (int ))
2525
2626 def __repr__ (self ) -> str :
27- status = None
27+ status : Optional [ str ] = None
2828 if self .receipt :
2929 try :
3030 from hiero_sdk_python .response_code import ResponseCode
3131 status = ResponseCode (self .receipt .status ).name
3232 except (ValueError , AttributeError ):
33- status = self .receipt .status
33+ status = str ( self .receipt .status )
3434 return (f"TransactionRecord(transaction_id='{ self .transaction_id } ', "
3535 f"transaction_hash={ self .transaction_hash .decode ('utf-8' )} , "
3636 f"transaction_memo='{ self .transaction_memo } ', "
Original file line number Diff line number Diff line change 1- from typing import Optional
1+ from typing import Optional , TYPE_CHECKING
22from hiero_sdk_python .account .account_id import AccountId
3- from hiero_sdk_python .transaction .transaction import Transaction
43from hiero_sdk_python .transaction .transaction_id import TransactionId
54from hiero_sdk_python .transaction .transaction_receipt import TransactionReceipt
65from hiero_sdk_python .client .client import Client
76
7+ if TYPE_CHECKING :
8+ from hiero_sdk_python .transaction .transaction import Transaction
9+
810class TransactionResponse :
911 """
1012 Represents the response from a transaction submitted to the Hedera network.
@@ -18,7 +20,7 @@ def __init__(self) -> None:
1820 self .node_id : AccountId = AccountId ()
1921 self .hash : bytes = bytes ()
2022 self .validate_status : bool = False
21- self .transaction : Optional [Transaction ] = None
23+ self .transaction : Optional [" Transaction" ] = None
2224
2325 def get_receipt (self , client : Client ) -> TransactionReceipt :
2426 """
Original file line number Diff line number Diff line change @@ -134,21 +134,21 @@ def build_transaction_body(self) -> transaction_body_pb2.TransactionBody:
134134 crypto_transfer_tx_body .transfers .CopyFrom (transfer_list )
135135
136136 # NFTs
137- for token_id , transfers in self .nft_transfers .items ():
137+ for token_id , nft_transfers in self .nft_transfers .items ():
138138 token_transfer_list = basic_types_pb2 .TokenTransferList (
139139 token = token_id ._to_proto ()
140140 )
141- for transfer in transfers :
141+ for transfer in nft_transfers :
142142 token_transfer_list .nftTransfers .append (transfer ._to_proto ())
143143
144144 crypto_transfer_tx_body .tokenTransfers .append (token_transfer_list )
145145
146146 # Tokens
147- for token_id , transfers in self .token_transfers .items ():
147+ for token_id , token_transfers in self .token_transfers .items ():
148148 token_transfer_list = basic_types_pb2 .TokenTransferList (
149149 token = token_id ._to_proto ()
150150 )
151- for account_id , amount in transfers .items ():
151+ for account_id , amount in token_transfers .items ():
152152 token_transfer_list .transfers .append (
153153 basic_types_pb2 .AccountAmount (
154154 accountID = account_id ._to_proto (),
You can’t perform that action at this time.
0 commit comments