diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr b/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr index d4d5a8f143d..a3d0ccf6d46 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr @@ -54,7 +54,7 @@ unconstrained fn test_get_scheduled_value_in_public() { let (scheduled, block_of_change) = state_var.get_scheduled_value(); assert_eq(scheduled, new_value); - assert_eq(block_of_change, env.block_number() + TEST_INITIAL_DELAY); + assert_eq(block_of_change, env.block_number() + 1 + TEST_INITIAL_DELAY); } #[test] @@ -120,7 +120,7 @@ unconstrained fn test_get_scheduled_delay_in_public() { let (scheduled, block_of_change) = state_var.get_scheduled_delay(); assert_eq(scheduled, new_delay); // The new delay is smaller, therefore we need to wait for the difference between current and new - assert_eq(block_of_change, env.block_number() + TEST_INITIAL_DELAY - new_delay); + assert_eq(block_of_change, env.block_number() + 1 + TEST_INITIAL_DELAY - new_delay); } #[test] diff --git a/noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr b/noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr index eba711b9f5b..5f315b3ba08 100644 --- a/noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr +++ b/noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr @@ -22,7 +22,7 @@ impl TestEnvironment { } pub unconstrained fn block_number(_self: Self) -> u32 { - get_block_number() + get_block_number() - 1 } pub unconstrained fn contract_address(_self: Self) -> AztecAddress { diff --git a/noir-projects/noir-contracts/contracts/router_contract/src/test.nr b/noir-projects/noir-contracts/contracts/router_contract/src/test.nr index 300b958e36d..58d67b2d238 100644 --- a/noir-projects/noir-contracts/contracts/router_contract/src/test.nr +++ b/noir-projects/noir-contracts/contracts/router_contract/src/test.nr @@ -14,7 +14,7 @@ unconstrained fn test_check_block_number() { // First we sanity-check that current block number is as expected let current_block_number = env.block_number(); - assert(current_block_number == 10, "Expected block number to be 10"); + assert(current_block_number == 9, "Expected block number to be 9"); // We test just one success case and 1 failure case in this test as the rest is tested in the comparator unit tests router.check_block_number(Comparator.LT, 11).call(&mut env.private()); @@ -32,7 +32,7 @@ unconstrained fn test_fail_check_block_number() { // First we sanity-check that current block number is as expected let current_block_number = env.block_number(); - assert(current_block_number == 10, "Expected block number to be 10"); + assert(current_block_number == 9, "Expected block number to be 9"); router.check_block_number(Comparator.LT, 5).call(&mut env.private()); }