Skip to content

Commit

Permalink
feat: reexport protocol_types from aztec-nr (#3926)
Browse files Browse the repository at this point in the history
This PR rexports `protocol_types` from `aztec-nr` so that users of
`aztec-nr` don't need to have a direct dependency on `protocol_types`

Closes AztecProtocol/aztec-packages#3590
  • Loading branch information
superstar0402 committed Jan 18, 2024
1 parent 69fc33f commit 33841a2
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 15 deletions.
1 change: 0 additions & 1 deletion address-note/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ type = "lib"

[dependencies]
aztec = { path = "../aztec" }
protocol_types = { path = "../../noir-protocol-circuits/src/crates/types" }
2 changes: 1 addition & 1 deletion address-note/src/address_note.nr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// docs:start:encrypted_import
use dep::aztec::log::emit_encrypted_log;
// docs:end:encrypted_import
use dep::protocol_types::address::AztecAddress;
use dep::aztec::{
protocol_types::address::AztecAddress,
note::{
note_header::NoteHeader,
note_interface::NoteInterface,
Expand Down
1 change: 0 additions & 1 deletion authwit/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ type = "lib"

[dependencies]
aztec = { path = "../aztec" }
protocol_types = { path = "../../noir-protocol-circuits/src/crates/types" }
10 changes: 7 additions & 3 deletions authwit/src/auth.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dep::protocol_types::{
use dep::aztec::protocol_types::{
abis::function_selector::FunctionSelector,
address::AztecAddress,
constants::{
Expand All @@ -22,7 +22,11 @@ global IS_VALID_PUBLIC_SELECTOR = 0xf3661153;

// docs:start:assert_valid_authwit
// Assert that `on_behalf_of` have authorized `message_hash` with a valid authentication witness
pub fn assert_valid_authwit(context: &mut PrivateContext, on_behalf_of: AztecAddress, message_hash: Field) {
pub fn assert_valid_authwit(
context: &mut PrivateContext,
on_behalf_of: AztecAddress,
message_hash: Field
) {
let is_valid_selector = FunctionSelector::from_field(IS_VALID_SELECTOR);
let result = context.call_private_function(on_behalf_of, is_valid_selector, [message_hash])[0];
context.push_new_nullifier(message_hash, 0);
Expand Down Expand Up @@ -82,4 +86,4 @@ pub fn compute_authwit_message_hash<N>(
GENERATOR_INDEX__SIGNATURE_PAYLOAD
)
}
// docs:end:compute_authwit_message_hash
// docs:end:compute_authwit_message_hash
2 changes: 1 addition & 1 deletion authwit/src/entrypoint.nr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use dep::aztec::abi;
use dep::aztec::types::vec::BoundedVec;
use dep::aztec::context::PrivateContext;
use dep::protocol_types::{
use dep::aztec::protocol_types::{
abis::{
call_stack_item::{
PrivateCallStackItem,
Expand Down
1 change: 1 addition & 0 deletions aztec/src/lib.nr
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ mod oracle;
mod state_vars;
mod types;
mod utils;
use dep::protocol_types;
1 change: 0 additions & 1 deletion compressed-string/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ type = "lib"

[dependencies]
aztec = {path = "../aztec"}
protocol_types = {path = "../../noir-protocol-circuits/src/crates/types"}
2 changes: 1 addition & 1 deletion compressed-string/src/compressed_string.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::aztec::types::type_serialization::TypeSerializationInterface;
use dep::protocol_types::utils::field::field_from_bytes;
use dep::aztec::protocol_types::utils::field::field_from_bytes;
use dep::std;

// A Fixedsize Compressed String.
Expand Down
1 change: 0 additions & 1 deletion easy-private-state/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ type = "lib"
[dependencies]
aztec = { path = "../aztec" }
value_note = { path = "../value-note" }
protocol_types = { path = "../../noir-protocol-circuits/src/crates/types" }
2 changes: 1 addition & 1 deletion easy-private-state/src/easy_private_state.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::protocol_types::address::AztecAddress;
use dep::aztec::{
protocol_types::address::AztecAddress,
context::Context,
note::note_getter_options::NoteGetterOptions,
state_vars::set::Set,
Expand Down
1 change: 0 additions & 1 deletion value-note/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ type = "lib"

[dependencies]
aztec = { path = "../aztec" }
protocol_types = { path = "../../noir-protocol-circuits/src/crates/types" }
2 changes: 1 addition & 1 deletion value-note/src/filter.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::std::option::Option;
use dep::protocol_types::constants::MAX_READ_REQUESTS_PER_CALL;
use dep::aztec::protocol_types::constants::MAX_READ_REQUESTS_PER_CALL;
use crate::value_note::ValueNote;

pub fn filter_notes_min_sum(
Expand Down
2 changes: 1 addition & 1 deletion value-note/src/utils.nr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
filter::filter_notes_min_sum,
value_note::{ValueNote, VALUE_NOTE_LEN},
};
use dep::protocol_types::address::AztecAddress;
use dep::aztec::protocol_types::address::AztecAddress;

// Sort the note values (0th field) in descending order.
// Pick the fewest notes whose sum is equal to or greater than `amount`.
Expand Down
2 changes: 1 addition & 1 deletion value-note/src/value_note.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::protocol_types::address::AztecAddress;
use dep::aztec::{
protocol_types::address::AztecAddress,
note::{
note_header::NoteHeader,
note_interface::NoteInterface,
Expand Down

0 comments on commit 33841a2

Please sign in to comment.