Skip to content

Commit ea5645f

Browse files
committed
fix: nargo fmt — apply v4-next-staging formatting
The cherry-picked test files use a multi-line wrapping style that doesn't match v4-next-staging's noirfmt.toml (max_width=120 fits the calls on a single line). Run `nargo fmt`: - public_checks_contract/src/test.nr: collapse the four `env.view_public(public_checks.check_*(...))` calls onto one line. - scope_test_contract/src/main.nr: drop a stray blank line between test functions. - test_log_contract/src/test/tx_effects.nr and aztec-nr/aztec/src/test/helpers/txe_oracles.nr: collapse a few multi-line constructs onto one line. Both hunks come from the #22889 backport now on staging; fix here so my PR's CI passes against the merged base.
1 parent 929f1dc commit ea5645f

4 files changed

Lines changed: 7 additions & 35 deletions

File tree

noir-projects/aztec-nr/aztec/src/test/helpers/txe_oracles.nr

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ pub struct TxEffects {
109109

110110
/// Returns the effects of the last transaction included by the TXE.
111111
pub unconstrained fn get_last_tx_effects() -> TxEffects {
112-
let (tx_hash, note_hashes, nullifiers, raw_log_storage, log_lengths, log_count) =
113-
get_last_tx_effects_oracle();
112+
let (tx_hash, note_hashes, nullifiers, raw_log_storage, log_lengths, log_count) = get_last_tx_effects_oracle();
114113

115114
let mut private_logs = BoundedVec::new();
116115
for i in 0..log_count {
@@ -121,14 +120,7 @@ pub unconstrained fn get_last_tx_effects() -> TxEffects {
121120
}
122121

123122
#[oracle(aztec_txe_getLastTxEffects)]
124-
unconstrained fn get_last_tx_effects_oracle() -> (
125-
Field,
126-
TxNoteHashes,
127-
TxNullifiers,
128-
[[Field; PRIVATE_LOG_SIZE_IN_FIELDS]; MAX_PRIVATE_LOGS_PER_TX],
129-
[u32; MAX_PRIVATE_LOGS_PER_TX],
130-
u32,
131-
) {}
123+
unconstrained fn get_last_tx_effects_oracle() -> (Field, TxNoteHashes, TxNullifiers, [[Field; PRIVATE_LOG_SIZE_IN_FIELDS]; MAX_PRIVATE_LOGS_PER_TX], [u32; MAX_PRIVATE_LOGS_PER_TX], u32) {}
132124

133125
/// Returns the raw offchain effect payloads emitted by the last top-level call into TXE.
134126
/// Each effect is a variable-length field array (e.g. offchain messages have a different size

noir-projects/noir-contracts/contracts/protocol/public_checks_contract/src/test.nr

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ unconstrained fn check_block_number() {
1313
let public_checks = PublicChecks::at(public_checks_contract_address);
1414

1515
let expected_next_block_number = env.next_block_number();
16-
env.view_public(public_checks.check_block_number(
17-
Comparator.LT,
18-
expected_next_block_number + 1,
19-
));
16+
env.view_public(public_checks.check_block_number(Comparator.LT, expected_next_block_number + 1));
2017
}
2118

2219
#[test(should_fail_with = "Block number mismatch.")]
@@ -27,10 +24,7 @@ unconstrained fn check_block_number_fail() {
2724
let public_checks = PublicChecks::at(public_checks_contract_address);
2825

2926
let expected_next_block_number = env.next_block_number();
30-
env.view_public(public_checks.check_block_number(
31-
Comparator.LT,
32-
expected_next_block_number,
33-
));
27+
env.view_public(public_checks.check_block_number(Comparator.LT, expected_next_block_number));
3428
}
3529

3630
#[test]
@@ -42,10 +36,7 @@ unconstrained fn check_timestamp() {
4236

4337
let expected_next_block_timestamp = env.last_block_timestamp() + 100;
4438
env.set_next_block_timestamp(expected_next_block_timestamp);
45-
env.view_public(public_checks.check_timestamp(
46-
Comparator.LT,
47-
expected_next_block_timestamp + 1,
48-
));
39+
env.view_public(public_checks.check_timestamp(Comparator.LT, expected_next_block_timestamp + 1));
4940
}
5041

5142
#[test(should_fail_with = "Timestamp mismatch.")]
@@ -57,8 +48,5 @@ unconstrained fn check_timestamp_fail() {
5748

5849
let expected_next_block_timestamp = env.last_block_timestamp() + 100;
5950
env.set_next_block_timestamp(expected_next_block_timestamp);
60-
env.view_public(public_checks.check_timestamp(
61-
Comparator.LT,
62-
expected_next_block_timestamp,
63-
));
51+
env.view_public(public_checks.check_timestamp(Comparator.LT, expected_next_block_timestamp));
6452
}

noir-projects/noir-contracts/contracts/test/scope_test_contract/src/main.nr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ pub contract ScopeTest {
145145
assert_eq(read_value, value);
146146
}
147147

148-
149148
#[test]
150149
unconstrained fn owner_can_view_own_notes() {
151150
let (mut env, contract_address) = setup();

noir-projects/noir-contracts/contracts/test/test_log_contract/src/test/tx_effects.nr

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,7 @@ unconstrained fn multiple_private_logs_with_varying_lengths() {
5959

6060
env.call_private(
6161
sender,
62-
test_log.emit_three_raw_private_logs_diff_lengths(
63-
tag1,
64-
payload1,
65-
tag2,
66-
payload2,
67-
tag3,
68-
payload3,
69-
),
62+
test_log.emit_three_raw_private_logs_diff_lengths(tag1, payload1, tag2, payload2, tag3, payload3),
7063
);
7164

7265
let private_logs = txe_oracles::get_last_tx_effects().private_logs;

0 commit comments

Comments
 (0)