Skip to content

Commit 62c368e

Browse files
Added Receipt Status Validation For Account Creation With EVM Alias (#2387)
Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Ayush Goyal <ayush.s1@somaiya.edu> Signed-off-by: Ayush Goyal <149329312+ayshgoyl@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 5c71d69 commit 62c368e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

examples/account/account_create_transaction_evm_alias.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
Hbar,
2525
PrivateKey,
2626
PublicKey,
27+
ResponseCode,
2728
)
2829

2930

@@ -90,7 +91,9 @@ def create_account_with_alias(client: Client, private_key: PrivateKey, public_ke
9091
# Execute the transaction
9192
response = transaction.execute(client)
9293

93-
# Safe retrieval of account ID
94+
if response.status != ResponseCode.SUCCESS:
95+
raise RuntimeError(f"Transaction failed with status: {ResponseCode(response.status).name}")
96+
9497
new_account_id = response.account_id
9598
if new_account_id is None:
9699
raise RuntimeError("AccountID not found in receipt. Account may not have been created.")

0 commit comments

Comments
 (0)