Skip to content

Commit 4b94571

Browse files
fixed precheckerror
Signed-off-by: tech0priyanshu <priyanshuyadv101106@gmail.com>
1 parent 70637d1 commit 4b94571

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

tests/integration/account_update_transaction_e2e_test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from hiero_sdk_python.crypto.key_list import KeyList
1313
from hiero_sdk_python.crypto.private_key import PrivateKey
1414
from hiero_sdk_python.Duration import Duration
15+
from hiero_sdk_python.exceptions import PrecheckError
1516
from hiero_sdk_python.hbar import Hbar
1617
from hiero_sdk_python.query.account_info_query import AccountInfoQuery
1718
from hiero_sdk_python.response_code import ResponseCode
@@ -283,10 +284,11 @@ def test_account_update_insufficient_fee_with_valid_expiration_bump(env):
283284
if not _apply_tiny_max_fee_if_supported(tx, env.client):
284285
pytest.skip("SDK lacks a max-fee API; cannot deterministically trigger INSUFFICIENT_TX_FEE.")
285286

286-
receipt = tx.execute(env.client)
287-
assert receipt.status == ResponseCode.INSUFFICIENT_TX_FEE, (
288-
f"Expected INSUFFICIENT_TX_FEE but got {ResponseCode(receipt.status).name}"
289-
)
287+
# If it succeeds or raises a different error, the test will fail.
288+
with pytest.raises(PrecheckError) as exc_info:
289+
tx.execute(env.client)
290+
291+
assert exc_info.value.status == ResponseCode.INSUFFICIENT_TX_FEE
290292

291293
# Confirm expiration time did not change
292294
info_after = AccountInfoQuery(account_id).execute(env.client)

0 commit comments

Comments
 (0)