Skip to content

Commit 0523114

Browse files
authored
docs: add backticks to links (#20045)
This will make them render more nicely in the docsite.
2 parents cff47b0 + 5e7e2cd commit 0523114

35 files changed

+230
-205
lines changed

noir-projects/aztec-nr/aztec/src/context/note_existence_request.nr

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::protocol::address::aztec_address::AztecAddress;
22

33
/// A request to assert the existence of a note.
44
///
5-
/// Used by [crate::context::PrivateContext::assert_note_exists].
5+
/// Used by [`crate::context::PrivateContext::assert_note_exists`].
66
pub struct NoteExistenceRequest {
77
note_hash: Field,
88
maybe_contract_address: Option<AztecAddress>,
@@ -13,7 +13,8 @@ impl NoteExistenceRequest {
1313
///
1414
/// Pending notes have not been yet assigned a nonce, and they therefore have no unique note hash. Instead, these
1515
/// requests are created using the unsiloed note hash (i.e. from
16-
/// [crate::note::note_interface::NoteHash::compute_note_hash]) and address of the contract that created the note.
16+
/// [`crate::note::note_interface::NoteHash::compute_note_hash`]) and address of the contract that created the
17+
/// note.
1718
pub fn for_pending(unsiloed_note_hash: Field, contract_address: AztecAddress) -> Self {
1819
// The kernel doesn't take options; it takes a note_hash and an address, and infers whether the request is
1920
// siloed based on whether the address is zero or non-zero. When passing the value to the kernel, we use

noir-projects/aztec-nr/aztec/src/context/nullifier_existence_request.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::protocol::address::aztec_address::AztecAddress;
22

33
/// A request to assert the existence of a nullifier.
44
///
5-
/// Used by [crate::context::private_context::PrivateContext::assert_nullifier_exists].
5+
/// Used by [`crate::context::private_context::PrivateContext::assert_nullifier_exists`].
66
pub struct NullifierExistenceRequest {
77
nullifier: Field,
88
maybe_contract_address: Option<AztecAddress>,

noir-projects/aztec-nr/aztec/src/context/private_context.nr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ impl PrivateContext {
637637
/// ## Historical Notes
638638
///
639639
/// If you need to assert that a note existed _by some specific block in the past_, instead of simply proving that
640-
/// it exists by the current anchor block, use [crate::history::note::assert_note_existed_by] instead.
640+
/// it exists by the current anchor block, use [`crate::history::note::assert_note_existed_by`] instead.
641641
///
642642
/// ## Cost
643643
///
@@ -673,7 +673,7 @@ impl PrivateContext {
673673
/// ## Historical Nullifiers
674674
///
675675
/// If you need to assert that a nullifier existed _by some specific block in the past_, instead of simply proving
676-
/// that it exists by the current anchor block, use [crate::history::nullifier::assert_nullifier_existed_by]
676+
/// that it exists by the current anchor block, use [`crate::history::nullifier::assert_nullifier_existed_by`]
677677
/// instead.
678678
///
679679
/// ## Public vs Private
@@ -685,7 +685,7 @@ impl PrivateContext {
685685
///
686686
/// This is not the case in public functions, which do have access to the tip of the blockchain and so can reliably
687687
/// prove whether a nullifier exists or not via
688-
/// [crate::context::public_context::PublicContext::nullifier_exists_unsafe].
688+
/// [`crate::context::public_context::PublicContext::nullifier_exists_unsafe`].
689689
///
690690
/// ## Cost
691691
///

noir-projects/aztec-nr/aztec/src/context/public_context.nr

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl PublicContext {
145145
/// Returns `true` if an `unsiloed_nullifier` has been emitted by `contract_address`.
146146
///
147147
/// Note that unsiloed nullifiers are not the actual values stored in the nullifier tree: they are first siloed via
148-
/// [crate::hash::compute_siloed_nullifier] with the emitting contract's address.
148+
/// [`crate::hash::compute_siloed_nullifier`] with the emitting contract's address.
149149
///
150150
/// ## Use Cases
151151
///
@@ -160,7 +160,8 @@ impl PublicContext {
160160
///
161161
/// In general, it is unsafe to check for nullifier non-existence in private, as that will not consider the
162162
/// possibility of the nullifier having been emitted in any transaction between the anchor block and the inclusion
163-
/// block. Private functions instead prove existence via [crate::context::PrivateContext::assert_nullifier_exists]
163+
/// block. Private functions instead prove existence via
164+
/// [`crate::context::PrivateContext::assert_nullifier_exists`]
164165
/// and 'prove' non-existence by _emitting_ the nullifer, which would cause the transaction to fail if the
165166
/// nullifier existed.
166167
///

noir-projects/aztec-nr/aztec/src/contract_self.nr

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use crate::protocol::{address::AztecAddress, traits::{Deserialize, Serialize}};
1717

1818
/// Core interface for interacting with aztec-nr contract features.
1919
///
20-
/// This struct is automatically injected into every [external](crate::macros::functions::external) and
21-
/// [internal](crate::macros::functions::internal) contract function by the Aztec macro system and is accessible
20+
/// This struct is automatically injected into every [`external`](crate::macros::functions::external) and
21+
/// [`internal`](crate::macros::functions::internal) contract function by the Aztec macro system and is accessible
2222
/// through the `self` variable.
2323
///
2424
/// ## Usage in Contract Functions
@@ -50,8 +50,8 @@ use crate::protocol::{address::AztecAddress, traits::{Deserialize, Serialize}};
5050
/// ## Type Parameters
5151
///
5252
/// - `Context`: The execution context type - either `&mut PrivateContext`, `PublicContext`, or `UtilityContext`
53-
/// - `Storage`: The contract's storage struct (defined with [storage](crate::macros::storage::storage), or `()` if the
54-
/// contract has no storage
53+
/// - `Storage`: The contract's storage struct (defined with [`storage`](crate::macros::storage::storage), or `()` if
54+
/// the contract has no storage
5555
/// - `CallSelf`: Macro-generated type for calling contract's own non-view functions
5656
/// - `EnqueueSelf`: Macro-generated type for enqueuing calls to the contract's own non-view functions
5757
/// - `CallSelfStatic`: Macro-generated type for calling contract's own view functions
@@ -61,8 +61,8 @@ pub struct ContractSelf<Context, Storage, CallSelf, EnqueueSelf, CallSelfStatic,
6161
pub address: AztecAddress,
6262

6363
/// The contract's storage instance, representing the struct to which the
64-
/// [storage](crate::macros::storage::storage) macro was applied in your contract. If the contract has no storage,
65-
/// the type of this will be `()`.
64+
/// [`storage`](crate::macros::storage::storage) macro was applied in your contract. If the contract has no
65+
/// storage, the type of this will be `()`.
6666
///
6767
/// This storage instance is specialized for the current execution context (private, public, or utility) and
6868
/// provides access to the contract's state variables. Each state variable accepts the context as a generic
@@ -73,13 +73,13 @@ pub struct ContractSelf<Context, Storage, CallSelf, EnqueueSelf, CallSelfStatic,
7373
///
7474
/// If you've arrived here while trying to access your contract's storage while the `Storage` generic type is set
7575
/// to unit type `()`, it means you haven't yet defined a Storage struct using the
76-
/// [storage](crate::macros::storage::storage) macro in your contract. For guidance on setting this up, please
76+
/// [`storage`](crate::macros::storage::storage) macro in your contract. For guidance on setting this up, please
7777
/// refer to our docs: https://docs.aztec.network/developers/docs/guides/smart_contracts/storage
7878

7979
pub storage: Storage,
8080

81-
/// The execution context whose type is determined by the [external](crate::macros::functions::external) attribute
82-
/// of the contract function based on the external function type (private, public, or utility).
81+
/// The execution context whose type is determined by the [`external`](crate::macros::functions::external)
82+
/// attribute of the contract function based on the external function type (private, public, or utility).
8383
pub context: Context,
8484

8585
/// Provides type-safe methods for calling this contract's own non-view functions.
@@ -176,16 +176,16 @@ impl<Storage, CallSelf, EnqueueSelf, CallSelfStatic, EnqueueSelfStatic, CallInte
176176
/// executed in a transaction (i.e. transaction entrypoint) does **not** have a caller. This function panics when
177177
/// executed in such a context.
178178
///
179-
/// If you need to handle these cases, use [PrivateContext::maybe_msg_sender].
179+
/// If you need to handle these cases, use [`PrivateContext::maybe_msg_sender`].
180180
pub fn msg_sender(self) -> AztecAddress {
181181
self.context.maybe_msg_sender().unwrap()
182182
}
183183

184184
/// Emits an event privately.
185185
///
186186
/// Unlike public events, private events do not reveal their contents publicly. They instead create an
187-
/// [EventMessage] containing the private event information, which **MUST** be delivered to a recipient via
188-
/// [EventMessage::deliver_to] in order for them to learn about the event. Multiple recipients can have the same
187+
/// [`EventMessage`] containing the private event information, which **MUST** be delivered to a recipient via
188+
/// [`EventMessage::deliver_to`] in order for them to learn about the event. Multiple recipients can have the same
189189
/// message be delivered to them.
190190
///
191191
/// # Example
@@ -206,7 +206,7 @@ impl<Storage, CallSelf, EnqueueSelf, CallSelfStatic, EnqueueSelfStatic, CallInte
206206
/// # Cost
207207
///
208208
/// Private event emission always results in the creation of a nullifer, which acts as a commitment to the event
209-
/// and is used by third parties to verify its authenticity. See [EventMessage::deliver_to] for the costs
209+
/// and is used by third parties to verify its authenticity. See [`EventMessage::deliver_to`] for the costs
210210
/// associated to delivery.
211211
///
212212
/// # Privacy
@@ -335,8 +335,8 @@ impl<Storage, CallSelf, EnqueueSelf, CallSelfStatic, EnqueueSelfStatic, CallInte
335335

336336
/// Enqueues a privacy-preserving public contract call function.
337337
///
338-
/// This is the same as [ContractSelf::enqueue], except it hides this calling contract's address from the target
339-
/// public function (i.e. [ContractSelf::msg_sender] will panic).
338+
/// This is the same as [`ContractSelf::enqueue`], except it hides this calling contract's address from the target
339+
/// public function (i.e. [`ContractSelf::msg_sender`] will panic).
340340
///
341341
/// This means the origin of the call (msg_sender) will not be publicly visible to any blockchain observers, nor to
342342
/// the target public function. If the target public function reads `self.msg_sender()` the call will revert.
@@ -460,9 +460,9 @@ impl<Storage, CallSelf, CallSelfStatic, CallInternal> ContractSelf<PublicContext
460460
/// ## Incognito Calls
461461
///
462462
/// Contracts can call public functions from private ones hiding their identity (see
463-
/// [enqueue_incognito](ContractSelf::enqueue_incognito)). This function reverts when executed in such a context.
463+
/// [`enqueue_incognito`](ContractSelf::enqueue_incognito)). This function reverts when executed in such a context.
464464
///
465-
/// If you need to handle these cases, use [PublicContext::maybe_msg_sender].
465+
/// If you need to handle these cases, use [`PublicContext::maybe_msg_sender`].
466466
pub fn msg_sender(self: Self) -> AztecAddress {
467467
self.context.maybe_msg_sender().unwrap()
468468
}

noir-projects/aztec-nr/aztec/src/event/event_emission.nr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub struct NewEvent<Event> {
1111
pub(crate) randomness: Field,
1212
}
1313

14-
/// Equivalent to `self.emit(event)`: see [crate::contract_self::ContractSelf::emit].
14+
/// Equivalent to `self.emit(event)`: see [`crate::contract_self::ContractSelf::emit`].
1515
pub fn emit_event_in_private<Event>(context: &mut PrivateContext, event: Event) -> EventMessage<Event>
1616
where
1717
Event: EventInterface + Serialize,
@@ -34,7 +34,7 @@ where
3434
EventMessage::new(NewEvent { event, randomness }, context)
3535
}
3636

37-
/// Equivalent to `self.emit(event)`: see [crate::contract_self::ContractSelf::emit].
37+
/// Equivalent to `self.emit(event)`: see [`crate::contract_self::ContractSelf::emit`].
3838
pub fn emit_event_in_public<Event>(context: PublicContext, event: Event)
3939
where
4040
Event: EventInterface + Serialize,

noir-projects/aztec-nr/aztec/src/event/event_interface.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ where
2525
)
2626
}
2727

28-
/// Unconstrained variant of [compute_private_event_commitment] which takes the event in serialized form.
28+
/// Unconstrained variant of [`compute_private_event_commitment`] which takes the event in serialized form.
2929
///
3030
/// This function is unconstrained as the mechanism it uses to compute the commitment would be very inefficient in a
3131
/// constrained environment (due to the hashing of a dynamically sized array). This is not an issue as it is typically

noir-projects/aztec-nr/aztec/src/event/event_message.nr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::protocol::{address::AztecAddress, traits::Serialize};
88
/// A message with information about an event that was emitted in the current contract call. This message **MUST** be
99
/// delivered to a recipient in order to not lose the private event information.
1010
///
11-
/// Use [EventMessage::deliver_to] to select a delivery mechanism.
11+
/// Use [`EventMessage::deliver_to`] to select a delivery mechanism.
1212
#[must_use = "Unused EventMessage result - use the `deliver_to` function to prevent the event information from being lost forever"]
1313
pub struct EventMessage<Event> {
1414
pub(crate) new_event: NewEvent<Event>,
@@ -35,7 +35,7 @@ where
3535
///
3636
/// The message is first encrypted to the recipient's public key, ensuring no other actor can read it.
3737
///
38-
/// The `delivery_mode` must be one of [crate::messages::message_delivery::MessageDeliveryEnum], and will inform
38+
/// The `delivery_mode` must be one of [`crate::messages::message_delivery::MessageDeliveryEnum`], and will inform
3939
/// costs (both proving time and TX fees) as well as delivery guarantees. This value must be a compile-time
4040
/// constant.
4141
///

noir-projects/aztec-nr/aztec/src/macros/aztec.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ comptime fn generate_process_message() -> Quoted {
313313
/// Checks that all functions in the module have a context macro applied.
314314
///
315315
/// Non-macroified functions are not allowed in contracts. They must all be one of
316-
/// [external](crate::macros::functions::external), [internal](crate::macros::functions::internal) or `test`.
316+
/// [`external`](crate::macros::functions::external), [`internal`](crate::macros::functions::internal) or `test`.
317317
comptime fn check_each_fn_macroified(m: Module) {
318318
for f in m.functions() {
319319
let name = f.name();

0 commit comments

Comments
 (0)