Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaiton committed Nov 4, 2024
1 parent b3cd39d commit 585f966
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/agent0/utils/block_before_timestamp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_block_number_before_timestamp(fast_chain_fixture: LocalChain):
initial_block_plus_one_time = fast_chain_fixture.block_time()

time_between_blocks = initial_block_plus_one_time - initial_block_time
assert time_between_blocks >= 2
assert time_between_blocks >= 1
fast_chain_fixture.mine_blocks(num_fuzz_runs - 1)
chain_block_number = fast_chain_fixture.block_number()

Expand All @@ -34,9 +34,9 @@ def test_block_number_before_timestamp(fast_chain_fixture: LocalChain):
for fuzz_iter in range(num_fuzz_runs):
# Grab a random block in the past & get the time
if fuzz_iter == 0: # test an edge case on the first iteration
test_block_number = initial_block_number + 2
test_block_number = initial_block_number + 3
else:
test_block_number = int(np.random.randint(initial_block_number + 2, chain_block_number - 1))
test_block_number = int(np.random.randint(initial_block_number + 3, chain_block_number - 1))
test_block_time = hyperdrive_interface.get_block_timestamp(hyperdrive_interface.get_block(test_block_number))

# Add a random amount of time that is less than the time between blocks
Expand Down

0 comments on commit 585f966

Please sign in to comment.