Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ struct EasyPrivateUint {

impl EasyPrivateUint {
fn new(storage_slot: Field) -> Self {
assert(storage_slot != 0); // Storage slot 0 not allowed. Storage slots must start from 1.
let set = Set {
storage_slot,
note_interface: ValueNoteMethods,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct ImmutableSingleton<Note, N> {

impl<Note, N> ImmutableSingleton<Note, N> {
fn new(storage_slot: Field, note_interface: NoteInterface<Note, N>) -> Self {
assert(storage_slot != 0); // Storage slot 0 not allowed. Storage slots must start from 1.
ImmutableSingleton { storage_slot, note_interface }
}

Expand Down
1 change: 1 addition & 0 deletions yarn-project/noir-libs/noir-aztec/src/state_vars/map.nr
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ struct Map<V> {

impl<V> Map<V> {
fn new(storage_slot: Field, state_var_constructor: fn (Field) -> V) -> Map<V> {
assert(storage_slot != 0); // Storage slot 0 not allowed. Storage slots must start from 1.
Map { storage_slot, state_var_constructor }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ struct PublicState<T, T_SERIALISED_LEN> {

impl<T, T_SERIALISED_LEN> PublicState<T, T_SERIALISED_LEN> {
fn new(storage_slot: Field, serialisation_methods: TypeSerialisationInterface<T, T_SERIALISED_LEN>) -> Self {
assert(storage_slot != 0); // Storage slot 0 not allowed. Storage slots must start from 1.
PublicState { storage_slot, serialisation_methods }
}

Expand Down
1 change: 1 addition & 0 deletions yarn-project/noir-libs/noir-aztec/src/state_vars/set.nr
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ struct Set<Note, N> {

impl<Note, N> Set<Note, N> {
fn new(storage_slot: Field, note_interface: NoteInterface<Note, N>) -> Self {
assert(storage_slot != 0); // Storage slot 0 not allowed. Storage slots must start from 1.
Set { storage_slot, note_interface }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct Singleton<Note, N> {

impl<Note, N> Singleton<Note, N> {
fn new(storage_slot: Field, note_interface: NoteInterface<Note, N>) -> Self {
assert(storage_slot != 0); // Storage slot 0 not allowed. Storage slots must start from 1.
Singleton { storage_slot, note_interface }
}

Expand Down