Skip to content

Commit 7aaaf3a

Browse files
authored
Fix reverted error message in wait_for_tx (#1206)
1 parent 4c25dc0 commit 7aaaf3a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

starknet_py/net/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ async def wait_for_tx(
179179
raise TransactionRejectedError(message=tx_receipt.rejection_reason)
180180

181181
if execution_status == TransactionExecutionStatus.REVERTED:
182-
raise TransactionRevertedError(message=tx_receipt.revert_error)
182+
# TODO (#1047): message should be always revert_reason once GatewayClient is deprecated
183+
raise TransactionRevertedError(
184+
message=(tx_receipt.revert_reason or tx_receipt.revert_error)
185+
)
183186

184187
if execution_status == TransactionExecutionStatus.SUCCEEDED:
185188
return tx_receipt

starknet_py/tests/e2e/tests_on_networks/client_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def test_wait_for_tx_reverted_full_node(full_node_account_integration):
6767
sign_invoke = await account.sign_invoke_transaction(calls=call, max_fee=int(1e16))
6868
invoke = await account.client.send_transaction(sign_invoke)
6969

70-
with pytest.raises(TransactionRevertedError, match=r".*reverted.*"):
70+
with pytest.raises(TransactionRevertedError, match="Input too long for arguments"):
7171
await account.client.wait_for_tx(tx_hash=invoke.transaction_hash)
7272

7373

0 commit comments

Comments
 (0)