Skip to content

Commit

Permalink
feat: Sync from noir (#5572)
Browse files Browse the repository at this point in the history
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
fix: unknown slice lengths coming from as_slice
(noir-lang/noir#4725)
chore: remove unused env vars from `Cross.toml`
(noir-lang/noir#4717)
feat: improve nargo check cli with --override flag and feedback for
existing files (noir-lang/noir#4575)
feat: Allow slices to brillig entry points
(noir-lang/noir#4713)
chore: simplify how `acvm_backend.wasm` is embedded
(noir-lang/noir#4703)
fix(acvm): Mark outputs of Opcode::Call solvable
(noir-lang/noir#4708)
fix: Field comparisons (noir-lang/noir#4704)
feat(acvm_js): Execute program
(noir-lang/noir#4694)
chore: simplify how blns is loaded into tests
(noir-lang/noir#4705)
fix(ssa): Do not use get_value_max_num_bits when we want pure type
information (noir-lang/noir#4700)
chore: remove conditional compilation around `acvm_js` package
(noir-lang/noir#4702)
feat(docs): Documenting noir codegen
(noir-lang/noir#4454)
chore: check for references to private functions during path resolution
(noir-lang/noir#4622)
chore: fix clippy errors (noir-lang/noir#4684)
fix: Last use analysis & make it an SSA pass
(noir-lang/noir#4686)
feat: improve SSA type-awareness in EQ and MUL instructions
(noir-lang/noir#4691)
feat: improve optimisations on range constraints
(noir-lang/noir#4690)
chore: remove last traces of nix
(noir-lang/noir#4679)
chore: Use is_entry_point helper on RuntimeType
(noir-lang/noir#4678)
END_COMMIT_OVERRIDE

---------

Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: sirasistant <sirasistant@gmail.com>
  • Loading branch information
3 people committed Apr 9, 2024
1 parent f7509d2 commit 2144cef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions aztec/src/state_vars/private_immutable.nr
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ impl<Note> PrivateImmutable<Note> {

// docs:start:view_note
unconstrained pub fn view_note<N>(self) -> Note where Note: NoteInterface<N> {
let options = NoteViewerOptions::new().set_limit(1);
view_notes(self.storage_slot, options)[0].unwrap()
let mut options = NoteViewerOptions::new();
view_notes(self.storage_slot, options.set_limit(1))[0].unwrap()
}
// docs:end:view_note
}
6 changes: 3 additions & 3 deletions aztec/src/state_vars/private_mutable.nr
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl<Note> PrivateMutable<Note> {
// docs:start:replace
pub fn replace<N>(self, new_note: &mut Note, broadcast: bool) where Note: NoteInterface<N> {
let context = self.context.unwrap();
let prev_note = get_note(context, self.storage_slot);
let prev_note: Note = get_note(context, self.storage_slot);

// Nullify previous note.
destroy_note(context, prev_note);
Expand Down Expand Up @@ -90,8 +90,8 @@ impl<Note> PrivateMutable<Note> {

// docs:start:view_note
unconstrained pub fn view_note<N>(self) -> Note where Note: NoteInterface<N> {
let options = NoteViewerOptions::new().set_limit(1);
view_notes(self.storage_slot, options)[0].unwrap()
let mut options = NoteViewerOptions::new();
view_notes(self.storage_slot, options.set_limit(1))[0].unwrap()
}
// docs:end:view_note
}
6 changes: 4 additions & 2 deletions tests/src/note_getter_test.nr
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ fn invalid_selector() {

let storage_slot: Field = 0;

let mut options = NoteGetterOptions::new().select(
let mut options = NoteGetterOptions::new();
options = options.select(
PropertySelector { index: 0, offset: 0, length: 32 },
10,
Option::some(Comparator.EQ)
Expand All @@ -97,7 +98,8 @@ fn invalid_note_order() {

let storage_slot: Field = 0;

let mut options = NoteGetterOptions::new().sort(
let mut options = NoteGetterOptions::new();
options = options.sort(
PropertySelector { index: 0, offset: 0, length: 32 },
SortOrder.DESC
);
Expand Down
4 changes: 2 additions & 2 deletions value-note/src/balance_utils.nr
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ unconstrained pub fn get_balance(set: PrivateSet<ValueNote>) -> Field {
unconstrained pub fn get_balance_with_offset(set: PrivateSet<ValueNote>, offset: u32) -> Field {
let mut balance = 0;
// docs:start:view_notes
let options = NoteViewerOptions::new().set_offset(offset);
let opt_notes = set.view_notes(options);
let mut options = NoteViewerOptions::new();
let opt_notes = set.view_notes(options.set_offset(offset));
// docs:end:view_notes
let len = opt_notes.len();
for i in 0..len {
Expand Down

0 comments on commit 2144cef

Please sign in to comment.