Skip to content

Commit

Permalink
fix test_eth_block_number_next_block_different (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristinaNikolaevaa authored Aug 9, 2024
1 parent 16974fc commit 7bc0561
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions integration/tests/basic/rpc/test_rpc_base_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
is_hex,
)
from utils.accounts import EthAccounts
from utils.helpers import cryptohex, gen_hash_of_block
from utils.helpers import cryptohex, gen_hash_of_block, wait_condition
from utils.models.error import EthError, EthError32602, NotSupportedMethodError
from utils.models.result import (
EthGasPriceResult,
Expand Down Expand Up @@ -260,16 +260,9 @@ def test_eth_block_number(self, json_rpc_client):
@pytest.mark.mainnet
def test_eth_block_number_next_block_different(self, json_rpc_client):
response = json_rpc_client.send_rpc(method="eth_blockNumber")
time.sleep(1)
response2 = json_rpc_client.send_rpc(method="eth_blockNumber")
assert wait_condition(lambda: json_rpc_client.send_rpc(
method="eth_blockNumber")["result"] != response["result"], timeout_sec=10)

assert "error" not in response and "error" not in response2
assert "result" in response and "result" in response2
assert rpc_checks.is_hex(response["result"]), f"Invalid response result {response['result']}"
assert rpc_checks.is_hex(response2["result"]), f"Invalid response result {response2['result']}"
assert response["result"] != response2["result"]
EthResult(**response)
EthResult(**response2)

# Geth returns different error message for None NDEV-3169
@pytest.mark.mainnet
Expand Down

0 comments on commit 7bc0561

Please sign in to comment.