4242from hiero_sdk_python .tokens .token_unpause_transaction import TokenUnpauseTransaction
4343from hiero_sdk_python .tokens .token_update_transaction import TokenUpdateTransaction
4444from hiero_sdk_python .tokens .token_wipe_transaction import TokenWipeTransaction
45- from hiero_sdk_python .transaction .transaction_receipt import TransactionReceipt
4645from tck .handlers .registry import rpc_method
4746from tck .param .custom_fee import CustomFeeParams , FixedFeeParams
4847from tck .param .token import (
9493from tck .util .constants import DEFAULT_GRPC_TIMEOUT
9594from tck .util .key_utils import get_key_from_string
9695from tck .util .param_utils import to_int
96+ from tck .util .transaction_utils import execute_validated
9797
9898
9999def _parse_hex (value : str , field_name : str ) -> bytes :
@@ -252,8 +252,7 @@ def create_token(params: CreateTokenParams) -> CreateTokenResponse:
252252 if params .commonTransactionParams is not None :
253253 params .commonTransactionParams .apply_common_params (transaction , client )
254254
255- response = transaction .execute (client , wait_for_receipt = False )
256- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
255+ receipt = execute_validated (transaction , client )
257256
258257 token_id = str (receipt .token_id ) if receipt .token_id else ""
259258
@@ -305,8 +304,7 @@ def cancel_airdrop(params: CancelAirdropParams) -> CancelAirdropResponse:
305304 if params .commonTransactionParams is not None :
306305 params .commonTransactionParams .apply_common_params (transaction , client )
307306
308- response = transaction .execute (client , wait_for_receipt = False )
309- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
307+ receipt = execute_validated (transaction , client )
310308
311309 return CancelAirdropResponse (status = ResponseCode (receipt .status ).name )
312310
@@ -339,8 +337,7 @@ def mint_token(params: MintTokenParams) -> MintTokenResponse:
339337 if params .commonTransactionParams is not None :
340338 params .commonTransactionParams .apply_common_params (transaction , client )
341339
342- response = transaction .execute (client , wait_for_receipt = False )
343- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
340+ receipt = execute_validated (transaction , client )
344341
345342 serial_numbers = [str (s ) for s in receipt .serial_numbers ] if receipt .serial_numbers else []
346343
@@ -452,8 +449,7 @@ def associate_token(params: AssociateTokenParams) -> AssociateTokenResponse:
452449 if params .commonTransactionParams is not None :
453450 params .commonTransactionParams .apply_common_params (transaction , client )
454451
455- response = transaction .execute (client , wait_for_receipt = False )
456- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
452+ receipt = execute_validated (transaction , client )
457453
458454 return AssociateTokenResponse (status = ResponseCode (receipt .status ).name )
459455
@@ -468,8 +464,7 @@ def delete_token(params: DeleteTokenParams) -> DeleteTokenResponse:
468464 if params .commonTransactionParams is not None :
469465 params .commonTransactionParams .apply_common_params (transaction , client )
470466
471- response = transaction .execute (client , wait_for_receipt = False )
472- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
467+ receipt = execute_validated (transaction , client )
473468
474469 return DeleteTokenResponse (status = ResponseCode (receipt .status ).name )
475470
@@ -484,8 +479,7 @@ def dissociate_token(params: DissociateTokenParams) -> DissociateTokenResponse:
484479 if params .commonTransactionParams is not None :
485480 params .commonTransactionParams .apply_common_params (transaction , client )
486481
487- response = transaction .execute (client , wait_for_receipt = False )
488- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
482+ receipt = execute_validated (transaction , client )
489483
490484 return DissociateTokenResponse (status = ResponseCode (receipt .status ).name )
491485
@@ -515,8 +509,7 @@ def unfreeze_token(params: UnfreezeTokenParams) -> UnfreezeTokenResponse:
515509 if params .commonTransactionParams is not None :
516510 params .commonTransactionParams .apply_common_params (transaction , client )
517511
518- response = transaction .execute (client , wait_for_receipt = False )
519- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
512+ receipt = execute_validated (transaction , client )
520513
521514 return UnfreezeTokenResponse (status = ResponseCode (receipt .status ).name )
522515
@@ -531,8 +524,7 @@ def freeze_token(params: FreezeTokenParams) -> FreezeTokenResponse:
531524 if params .commonTransactionParams is not None :
532525 params .commonTransactionParams .apply_common_params (transaction , client )
533526
534- response = transaction .execute (client , wait_for_receipt = False )
535- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
527+ receipt = execute_validated (transaction , client )
536528
537529 return FreezeTokenResponse (status = ResponseCode (receipt .status ).name )
538530
@@ -547,8 +539,7 @@ def pause_token(params: PauseTokenParams) -> PauseTokenResponse:
547539 if params .commonTransactionParams is not None :
548540 params .commonTransactionParams .apply_common_params (transaction , client )
549541
550- response = transaction .execute (client , wait_for_receipt = False )
551- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
542+ receipt = execute_validated (transaction , client )
552543
553544 return PauseTokenResponse (status = ResponseCode (receipt .status ).name )
554545
@@ -563,8 +554,7 @@ def unpause_token(params: UnpauseTokenParams) -> UnpauseTokenResponse:
563554 if params .commonTransactionParams is not None :
564555 params .commonTransactionParams .apply_common_params (transaction , client )
565556
566- response = transaction .execute (client , wait_for_receipt = False )
567- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
557+ receipt = execute_validated (transaction , client )
568558
569559 return UnpauseTokenResponse (status = ResponseCode (receipt .status ).name )
570560
@@ -579,8 +569,7 @@ def grant_token_kyc(params: GrantTokenKycParams) -> GrantTokenKycResponse:
579569 if params .commonTransactionParams is not None :
580570 params .commonTransactionParams .apply_common_params (transaction , client )
581571
582- response = transaction .execute (client , wait_for_receipt = False )
583- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
572+ receipt = execute_validated (transaction , client )
584573
585574 return GrantTokenKycResponse (status = ResponseCode (receipt .status ).name )
586575
@@ -595,8 +584,7 @@ def revoke_token_kyc(params: RevokeTokenKycParams) -> RevokeTokenKycResponse:
595584 if params .commonTransactionParams is not None :
596585 params .commonTransactionParams .apply_common_params (transaction , client )
597586
598- response = transaction .execute (client , wait_for_receipt = False )
599- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
587+ receipt = execute_validated (transaction , client )
600588
601589 return RevokeTokenKycResponse (status = ResponseCode (receipt .status ).name )
602590
@@ -657,10 +645,7 @@ def airdrop_token(params: AirdropTokenParams) -> AirdropTokenResponse:
657645 if params .commonTransactionParams is not None :
658646 params .commonTransactionParams .apply_common_params (tx , client )
659647
660- receipt = tx .execute (client , wait_for_receipt = False ).get_receipt (
661- client ,
662- validate_status = True ,
663- )
648+ receipt = execute_validated (tx , client )
664649
665650 return AirdropTokenResponse (status = ResponseCode (receipt .status ).name )
666651
@@ -704,8 +689,7 @@ def claim_token(params: ClaimTokenParams) -> ClaimTokenResponse:
704689 if params .commonTransactionParams is not None :
705690 params .commonTransactionParams .apply_common_params (transaction , client )
706691
707- response = transaction .execute (client , wait_for_receipt = False )
708- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
692+ receipt = execute_validated (transaction , client )
709693
710694 return ClaimTokenResponse (status = ResponseCode (receipt .status ).name )
711695
@@ -897,8 +881,7 @@ def reject_token(params: RejectTokenParams) -> RejectTokenResponse:
897881 if params .commonTransactionParams is not None :
898882 params .commonTransactionParams .apply_common_params (transaction , client )
899883
900- response = transaction .execute (client , wait_for_receipt = False )
901- receipt = response .get_receipt (client , validate_status = True )
884+ receipt = execute_validated (transaction , client )
902885
903886 return RejectTokenResponse (
904887 status = ResponseCode (receipt .status ).name ,
@@ -973,8 +956,7 @@ def update_token(params: UpdateTokenParams) -> UpdateTokenResponse:
973956 if params .commonTransactionParams is not None :
974957 params .commonTransactionParams .apply_common_params (transaction , client )
975958
976- response = transaction .execute (client , wait_for_receipt = False )
977- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
959+ receipt = execute_validated (transaction , client )
978960
979961 return UpdateTokenResponse (status = ResponseCode (receipt .status ).name )
980962
@@ -1011,8 +993,7 @@ def wipe_token(params: WipeTokenParams) -> WipeTokenResponse:
1011993 if params .commonTransactionParams is not None :
1012994 params .commonTransactionParams .apply_common_params (transaction , client )
1013995
1014- response = transaction .execute (client , wait_for_receipt = False )
1015- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
996+ receipt = execute_validated (transaction , client )
1016997
1017998 return WipeTokenResponse (status = ResponseCode (receipt .status ).name )
1018999
@@ -1045,8 +1026,7 @@ def burn_token(params: BurnTokenParams) -> BurnTokenResponse:
10451026 if params .commonTransactionParams is not None :
10461027 params .commonTransactionParams .apply_common_params (transaction , client )
10471028
1048- response = transaction .execute (client , wait_for_receipt = False )
1049- receipt : TransactionReceipt = response .get_receipt (client , validate_status = True )
1029+ receipt = execute_validated (transaction , client )
10501030
10511031 return BurnTokenResponse (
10521032 newTotalSupply = str (receipt .new_total_supply ),
0 commit comments