Skip to content

Commit 79cab79

Browse files
committed
fmt
1 parent 93d88d2 commit 79cab79

File tree

2 files changed

+35
-36
lines changed

2 files changed

+35
-36
lines changed

noir-projects/aztec-nr/authwit/src/auth.nr

+23-22
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,12 @@ pub unconstrained fn assert_inner_hash_valid_authwit_public(
281281
on_behalf_of: AztecAddress,
282282
inner_hash: Field,
283283
) {
284-
let results: [Field] = context
285-
.call_public_function(
286-
CANONICAL_AUTH_REGISTRY_ADDRESS,
287-
comptime { FunctionSelector::from_signature("consume((Field),Field)") },
288-
[on_behalf_of.to_field(), inner_hash].as_slice(),
289-
GasOpts::default(),
290-
);
284+
let results: [Field] = context.call_public_function(
285+
CANONICAL_AUTH_REGISTRY_ADDRESS,
286+
comptime { FunctionSelector::from_signature("consume((Field),Field)") },
287+
[on_behalf_of.to_field(), inner_hash].as_slice(),
288+
GasOpts::default(),
289+
);
291290
assert(results.len() == 1, "Invalid response from registry");
292291
assert(results[0] == IS_VALID_SELECTOR, "Message not authorized by account");
293292
}
@@ -377,14 +376,17 @@ pub fn compute_authwit_message_hash(
377376
* @param message_hash The hash of the message to authorize
378377
* @param authorize True if the message should be authorized, false if it should be revoked
379378
*/
380-
pub unconstrained fn set_authorized(context: &mut PublicContext, message_hash: Field, authorize: bool) {
381-
let res = context
382-
.call_public_function(
383-
CANONICAL_AUTH_REGISTRY_ADDRESS,
384-
comptime { FunctionSelector::from_signature("set_authorized(Field,bool)") },
385-
[message_hash, authorize as Field].as_slice(),
386-
GasOpts::default(),
387-
);
379+
pub unconstrained fn set_authorized(
380+
context: &mut PublicContext,
381+
message_hash: Field,
382+
authorize: bool,
383+
) {
384+
let res = context.call_public_function(
385+
CANONICAL_AUTH_REGISTRY_ADDRESS,
386+
comptime { FunctionSelector::from_signature("set_authorized(Field,bool)") },
387+
[message_hash, authorize as Field].as_slice(),
388+
GasOpts::default(),
389+
);
388390
assert(res.len() == 0);
389391
}
390392

@@ -396,12 +398,11 @@ pub unconstrained fn set_authorized(context: &mut PublicContext, message_hash: F
396398
* @param reject True if all authwits should be rejected, false otherwise
397399
*/
398400
pub unconstrained fn set_reject_all(context: &mut PublicContext, reject: bool) {
399-
let res = context
400-
.call_public_function(
401-
CANONICAL_AUTH_REGISTRY_ADDRESS,
402-
comptime { FunctionSelector::from_signature("set_reject_all(bool)") },
403-
[context.this_address().to_field(), reject as Field].as_slice(),
404-
GasOpts::default(),
405-
);
401+
let res = context.call_public_function(
402+
CANONICAL_AUTH_REGISTRY_ADDRESS,
403+
comptime { FunctionSelector::from_signature("set_reject_all(bool)") },
404+
[context.this_address().to_field(), reject as Field].as_slice(),
405+
GasOpts::default(),
406+
);
406407
assert(res.len() == 0);
407408
}

noir-projects/aztec-nr/aztec/src/test/helpers/utils.nr

+12-14
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@ impl<let N: u32, let M: u32> Deployer<N, M> {
7474

7575
let mut public_context = PublicContext::new(|| panic(f"Provide args hash manually"));
7676

77-
let results = public_context
78-
.call_public_function(
79-
instance.to_address(),
80-
call_interface.get_selector(),
81-
call_interface.get_args(),
82-
GasOpts::default(),
83-
);
77+
let results = public_context.call_public_function(
78+
instance.to_address(),
79+
call_interface.get_selector(),
80+
call_interface.get_args(),
81+
GasOpts::default(),
82+
);
8483
assert(results.len() == 0);
8584

8685
instance
@@ -105,13 +104,12 @@ impl<let N: u32, let M: u32> Deployer<N, M> {
105104

106105
let mut public_context = PublicContext::new(|| panic(f"Provide args hash manually"));
107106

108-
let _ = public_context
109-
.call_public_function(
110-
instance.to_address(),
111-
call_interface.get_selector(),
112-
call_interface.get_args(),
113-
GasOpts::default(),
114-
);
107+
let _ = public_context.call_public_function(
108+
instance.to_address(),
109+
call_interface.get_selector(),
110+
call_interface.get_args(),
111+
GasOpts::default(),
112+
);
115113

116114
instance
117115
}

0 commit comments

Comments
 (0)