Skip to content

Commit

Permalink
test: update integration test with hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Den authored and Den committed Sep 10, 2024
1 parent 78d7788 commit f63a58b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/common/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ def send_raw_transaction(signed_transaction: str):
raise ValueError("No result found in the call_method_response")
transaction_hash = call_method_response["result"]["data"]["transaction_hash"]

transaction_response = wait_for_transaction(transaction_id)
transaction_response = wait_for_transaction(transaction_hash)
return (call_method_response, transaction_response)


def wait_for_transaction(transaction_id: str, interval: int = 10, retries: int = 15):
def wait_for_transaction(transaction_hash: str, interval: int = 10, retries: int = 15):
attempts = 0
while attempts < retries:
transaction_response = get_transaction_by_hash(str(transaction_hash))
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/accounts/test_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def test_accounts_funding():
payload("fund_account", new_account_address, fund_amount)
).json()
assert has_success_status(fund_account_result)
assert "transaction_id" in fund_account_result["result"]["data"]
wait_for_transaction(fund_account_result["result"]["data"]["transaction_id"])
assert "transaction_hash" in fund_account_result["result"]["data"]
wait_for_transaction(fund_account_result["result"]["data"]["transaction_hash"])

# Verify balance after funding
get_balance_after_fund_result = post_request_localhost(
Expand Down Expand Up @@ -75,7 +75,7 @@ def test_accounts_transfers():
fund_account_result = post_request_localhost(
payload("fund_account", account_1_address, fund_amount)
).json()
wait_for_transaction(fund_account_result["result"]["data"]["transaction_id"])
wait_for_transaction(fund_account_result["result"]["data"]["transaction_hash"])

# Test transfer
transfer_amount = 200
Expand Down Expand Up @@ -113,7 +113,7 @@ def test_accounts_burn():
fund_account_result = post_request_localhost(
payload("fund_account", account_1_address, fund_amount)
).json()
wait_for_transaction(fund_account_result["result"]["data"]["transaction_id"])
wait_for_transaction(fund_account_result["result"]["data"]["transaction_hash"])

# Test burn
burn_amount = 200
Expand Down

0 comments on commit f63a58b

Please sign in to comment.