Skip to content

Commit d0b57f2

Browse files
authored
chore: use returns true for boolean fns (#21186)
Minor inconsistency spotted by @nchamo.
1 parent 240ff6e commit d0b57f2

7 files changed

Lines changed: 11 additions & 11 deletions

File tree

noir-projects/aztec-nr/aztec/src/note/note_metadata.nr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,21 @@ impl NoteMetadata {
6868
}
6969
}
7070

71-
/// Returns true if the note is pending **and** from the same phase, i.e. if it's been created in the current
71+
/// Returns `true` if the note is pending **and** from the same phase, i.e. if it's been created in the current
7272
/// transaction during the current execution phase (either non-revertible or revertible).
7373
pub fn is_pending_same_phase(self) -> bool {
7474
self.stage == NoteStage.PENDING_SAME_PHASE
7575
}
7676

77-
/// Returns true if the note is pending **and** from the previous phase, i.e. if it's been created in the current
77+
/// Returns `true` if the note is pending **and** from the previous phase, i.e. if it's been created in the current
7878
/// transaction during an execution phase prior to the current one. Because private execution only has two phases
7979
/// with strict ordering, this implies that the note was created in the non-revertible phase, and that the current
8080
/// phase is the revertible phase.
8181
pub fn is_pending_previous_phase(self) -> bool {
8282
self.stage == NoteStage.PENDING_PREVIOUS_PHASE
8383
}
8484

85-
/// Returns true if the note is settled, i.e. if it's been created in a prior transaction and is therefore already
85+
/// Returns `true` if the note is settled, i.e. if it's been created in a prior transaction and is therefore already
8686
/// in the note hash tree.
8787
pub fn is_settled(self) -> bool {
8888
self.stage == NoteStage.SETTLED

noir-projects/aztec-nr/aztec/src/oracle/nullifiers.nr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub fn notify_created_nullifier(inner_nullifier: Field) {
1414
#[oracle(aztec_prv_notifyCreatedNullifier)]
1515
unconstrained fn notify_created_nullifier_oracle(_inner_nullifier: Field) {}
1616

17-
/// Returns true if the nullifier has been emitted in the same transaction, i.e. if [`notify_created_nullifier`] has
17+
/// Returns `true` if the nullifier has been emitted in the same transaction, i.e. if [`notify_created_nullifier`] has
1818
/// been
1919
/// called for this inner nullifier from the contract with the specified address.
2020
///
@@ -29,7 +29,7 @@ pub unconstrained fn is_nullifier_pending(inner_nullifier: Field, contract_addre
2929
#[oracle(aztec_prv_isNullifierPending)]
3030
unconstrained fn is_nullifier_pending_oracle(_inner_nullifier: Field, _contract_address: AztecAddress) -> bool {}
3131

32-
/// Returns true if the nullifier exists. Note that a `true` value can be constrained by proving existence of the
32+
/// Returns `true` if the nullifier exists. Note that a `true` value can be constrained by proving existence of the
3333
/// nullifier, but a `false` value should not be relied upon since other transactions may emit this nullifier before
3434
/// the current transaction is included in a block. While this might seem of little use at first, certain design
3535
/// patterns benefit from this abstraction (see e.g. `PrivateMutable`).

noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ where
143143
self.compute_initialization_nullifier(secret)
144144
}
145145

146-
/// Returns whether this PrivateImmutable has been initialized.
146+
/// Returns `true` if this PrivateImmutable has been initialized.
147147
pub unconstrained fn is_initialized(self) -> bool {
148148
let nullifier = self.get_initialization_nullifier();
149149
check_nullifier_exists(nullifier)

noir-projects/aztec-nr/aztec/src/state_vars/public_immutable.nr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ impl<T> PublicImmutable<T, PublicContext> {
214214
WithHash::public_storage_read(self.context, self.storage_slot)
215215
}
216216

217-
/// Returns true if the `PublicImmutable` has been initialized.
217+
/// Returns `true` if the `PublicImmutable` has been initialized.
218218
///
219219
/// ## Examples:
220220
///
@@ -263,7 +263,7 @@ impl<T> PublicImmutable<T, UtilityContext> {
263263
WithHash::utility_public_storage_read(self.context, self.storage_slot)
264264
}
265265

266-
/// Returns true if the `PublicImmutable` has been initialized.
266+
/// Returns `true` if the `PublicImmutable` has been initialized.
267267
pub unconstrained fn is_initialized(self) -> bool {
268268
let nullifier = self.compute_initialization_inner_nullifier();
269269
check_nullifier_exists(nullifier)

noir-projects/aztec-nr/aztec/src/state_vars/single_private_immutable.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ where
158158
self.compute_initialization_nullifier(secret)
159159
}
160160

161-
/// Returns whether this SinglePrivateImmutable has been initialized.
161+
/// Returns `true` if this SinglePrivateImmutable has been initialized.
162162
pub unconstrained fn is_initialized(self) -> bool {
163163
let nullifier = self.get_initialization_nullifier();
164164
check_nullifier_exists(nullifier)

noir-projects/aztec-nr/aztec/src/state_vars/single_private_mutable.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ where
249249
self.compute_initialization_nullifier(secret)
250250
}
251251

252-
/// Returns whether this SinglePrivateImmutable has been initialized.
252+
/// Returns `true` if this SinglePrivateMutable has been initialized.
253253
pub unconstrained fn is_initialized(self) -> bool {
254254
let nullifier = self.get_initialization_nullifier();
255255
check_nullifier_exists(nullifier)

noir-projects/aztec-nr/aztec/src/state_vars/single_use_claim.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl SingleUseClaim<&mut PrivateContext> {
132132
}
133133

134134
impl SingleUseClaim<UtilityContext> {
135-
/// Returns whether an owner has claimed this single use claim.
135+
/// Returns `true` if an owner has claimed this single use claim.
136136
pub unconstrained fn has_claimed(self) -> bool {
137137
let owner_nhk_app = get_nhk_app(get_public_keys(self.owner).npk_m.hash());
138138
check_nullifier_exists(self.compute_nullifier(owner_nhk_app))

0 commit comments

Comments
 (0)