Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
sklppy88 committed Feb 10, 2025
1 parent fff0f04 commit 69c913c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
}
Expand Down

0 comments on commit 69c913c

Please sign in to comment.