From 166025457586bf5e7c86d9b69ee05d0d87a69cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Tue, 23 Apr 2024 13:03:51 -0300 Subject: [PATCH] feat!: delete field note (#5959) `TestContract` was its sole user, so I just created `TestNote` inside that crate to replace it. Closes https://github.com/AztecProtocol/aztec-packages/issues/5932 --- Nargo.toml | 1 - field-note/Nargo.toml | 8 -------- field-note/src/field_note.nr | 40 ------------------------------------ field-note/src/lib.nr | 1 - 4 files changed, 50 deletions(-) delete mode 100644 field-note/Nargo.toml delete mode 100644 field-note/src/field_note.nr delete mode 100644 field-note/src/lib.nr diff --git a/Nargo.toml b/Nargo.toml index e3d50c4..1445794 100644 --- a/Nargo.toml +++ b/Nargo.toml @@ -5,7 +5,6 @@ members = [ "aztec", "compressed-string", "easy-private-state", - "field-note", "value-note", "tests", ] diff --git a/field-note/Nargo.toml b/field-note/Nargo.toml deleted file mode 100644 index 908a532..0000000 --- a/field-note/Nargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "field_note" -authors = ["aztec-labs"] -compiler_version = ">=0.18.0" -type = "lib" - -[dependencies] -aztec = { path = "../aztec" } \ No newline at end of file diff --git a/field-note/src/field_note.nr b/field-note/src/field_note.nr deleted file mode 100644 index f6350dd..0000000 --- a/field-note/src/field_note.nr +++ /dev/null @@ -1,40 +0,0 @@ -use dep::aztec::{ - note::{note_header::NoteHeader, note_interface::NoteInterface}, hash::pedersen_hash, - context::PrivateContext -}; - -global FIELD_NOTE_LEN: Field = 1; - -// A note which stores a field and is expected to be passed around using the `addNote` function. -// WARNING: This Note is not private as it does not contain randomness and hence it can be easy to perform serialized_note -// attack on it. -#[aztec(note)] -struct FieldNote { - value: Field, -} - -impl NoteInterface for FieldNote { - - fn compute_nullifier(self, _context: &mut PrivateContext) -> Field { - // This note is expected to be shared between users and for this reason can't be nullified using a secret. - 0 - } - - fn compute_nullifier_without_context(self) -> Field { - // This note is expected to be shared between users and for this reason can't be nullified using a secret. - 0 - } - - fn broadcast(self, context: &mut PrivateContext, slot: Field) { - assert( - false, "FieldNote does not support broadcast. Add it to PXE directly using the `.addNote` function." - ); - } -} - -impl FieldNote { - pub fn new(value: Field) -> Self { - FieldNote { value, header: NoteHeader::empty() } - } -} - diff --git a/field-note/src/lib.nr b/field-note/src/lib.nr deleted file mode 100644 index 71523fc..0000000 --- a/field-note/src/lib.nr +++ /dev/null @@ -1 +0,0 @@ -mod field_note;