Skip to content

Commit b6e66f8

Browse files
nventurobenesjan
andauthored
chore: remove _experimental_ prefix from utility call ifaces (#16150)
There never was really a great reason to do this - there is nothing "experimental" about these interfaces. Co-authored-by: benesjan <[email protected]>
1 parent b33ac0f commit b6e66f8

File tree

5 files changed

+21
-43
lines changed

5 files changed

+21
-43
lines changed

noir-projects/aztec-nr/aztec/src/macros/functions/call_interface_stubs.nr

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,8 @@ comptime fn create_utility_stub(f: FunctionDefinition) -> Quoted {
169169
create_stub_base(f);
170170
let fn_return_type = f.return_type();
171171

172-
// This is here because utility function call interfaces can only be used within TXe tests.
173-
let modified_fn_name = f"_experimental_{fn_name}".quoted_contents();
174-
175172
quote {
176-
pub fn $modified_fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::UtilityCallInterface<$fn_name_len, $fn_return_type> {
173+
pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::UtilityCallInterface<$fn_name_len, $fn_return_type> {
177174
$serialized_args_slice_construction
178175
let selector = $FROM_FIELD($fn_selector);
179176
dep::aztec::context::call_interfaces::UtilityCallInterface::new(

noir-projects/noir-contracts/contracts/app/nft_contract/src/test/utils.nr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ pub unconstrained fn assert_owns_private_nft(
7474
owner: AztecAddress,
7575
token_id: Field,
7676
) {
77-
let (private_nfts, _) = env.simulate_utility(NFT::at(nft_contract_address)
78-
._experimental_get_private_nfts(owner, 0));
77+
let (private_nfts, _) =
78+
env.simulate_utility(NFT::at(nft_contract_address).get_private_nfts(owner, 0));
7979

8080
let mut nft_found = false;
8181
for obtained_token_id in private_nfts {

noir-projects/noir-contracts/contracts/app/token_contract/src/test/utils.nr

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ pub unconstrained fn check_private_balance(
8484
address_amount: u128,
8585
) {
8686
assert_eq(
87-
env.simulate_utility(Token::at(token_contract_address)._experimental_balance_of_private(
88-
address,
89-
)),
87+
env.simulate_utility(Token::at(token_contract_address).balance_of_private(address)),
9088
address_amount,
9189
);
9290
}

noir-projects/noir-contracts/contracts/test/counter_contract/src/main.nr

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ pub contract Counter {
124124
let (mut env, contract_address, owner) = setup(initial_value);
125125

126126
// Read the stored value in the note
127-
let initial_counter = env.simulate_utility(Counter::at(contract_address)
128-
._experimental_get_counter(owner));
127+
let initial_counter =
128+
env.simulate_utility(Counter::at(contract_address).get_counter(owner));
129129
assert(
130130
initial_counter == initial_value,
131131
f"Expected {initial_value} but got {initial_counter}",
@@ -134,8 +134,8 @@ pub contract Counter {
134134
// Increment the counter
135135
env.call_private(owner, Counter::at(contract_address).increment(owner));
136136

137-
let incremented_counter = env.simulate_utility(Counter::at(contract_address)
138-
._experimental_get_counter(owner));
137+
let incremented_counter =
138+
env.simulate_utility(Counter::at(contract_address).get_counter(owner));
139139
let expected_current_value = initial_value + 1;
140140
assert(
141141
expected_current_value == incremented_counter,
@@ -150,31 +150,22 @@ pub contract Counter {
150150
let (env, contract_address, owner) = setup(initial_value);
151151

152152
// Checking that the note was discovered from private logs
153-
let initial_note_value = env.simulate_utility(Counter::at(contract_address)
154-
._experimental_get_counter(owner));
153+
let initial_note_value =
154+
env.simulate_utility(Counter::at(contract_address).get_counter(owner));
155155
assert(initial_note_value == initial_value);
156156

157157
env.call_private(owner, Counter::at(contract_address).increment_twice(owner));
158158

159-
assert_eq(
160-
env.simulate_utility(Counter::at(contract_address)._experimental_get_counter(owner)),
161-
7,
162-
);
159+
assert_eq(env.simulate_utility(Counter::at(contract_address).get_counter(owner)), 7);
163160

164161
let _ = env.call_private(
165162
owner,
166163
Counter::at(contract_address).increment_and_decrement(owner),
167164
);
168-
assert_eq(
169-
env.simulate_utility(Counter::at(contract_address)._experimental_get_counter(owner)),
170-
7,
171-
);
165+
assert_eq(env.simulate_utility(Counter::at(contract_address).get_counter(owner)), 7);
172166

173167
env.call_private(owner, Counter::at(contract_address).decrement(owner));
174-
assert_eq(
175-
env.simulate_utility(Counter::at(contract_address)._experimental_get_counter(owner)),
176-
6,
177-
);
168+
assert_eq(env.simulate_utility(Counter::at(contract_address).get_counter(owner)), 6);
178169
}
179170
}
180171
}

noir-projects/noir-contracts/contracts/test/test_contract/src/test/note_delivery.nr

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ unconstrained fn create_note_private_only_tx_and_read_in_utility() {
4949
test_contract.call_create_note(VALUE, recipient, STORAGE_SLOT, make_tx_hybrid),
5050
);
5151

52-
let retrieved = env.simulate_utility(test_contract._experimental_call_view_notes(
53-
STORAGE_SLOT,
54-
ACTIVE_OR_NULLIFIED,
55-
));
52+
let retrieved =
53+
env.simulate_utility(test_contract.call_view_notes(STORAGE_SLOT, ACTIVE_OR_NULLIFIED));
5654
assert_eq(retrieved, VALUE);
5755
}
5856

@@ -86,10 +84,8 @@ unconstrained fn create_note_hybrid_tx_and_read_in_utility() {
8684
test_contract.call_create_note(VALUE, recipient, STORAGE_SLOT, make_tx_hybrid),
8785
);
8886

89-
let retrieved = env.simulate_utility(test_contract._experimental_call_view_notes(
90-
STORAGE_SLOT,
91-
ACTIVE_OR_NULLIFIED,
92-
));
87+
let retrieved =
88+
env.simulate_utility(test_contract.call_view_notes(STORAGE_SLOT, ACTIVE_OR_NULLIFIED));
9389
assert_eq(retrieved, VALUE);
9490
}
9591

@@ -121,10 +117,8 @@ unconstrained fn create_partial_note_in_one_tx_and_read_in_utility() {
121117
test_contract.call_create_and_complete_partial_note(recipient, STORAGE_SLOT, VALUE),
122118
);
123119

124-
let retrieved = env.simulate_utility(test_contract._experimental_call_view_notes(
125-
STORAGE_SLOT,
126-
ACTIVE_OR_NULLIFIED,
127-
));
120+
let retrieved =
121+
env.simulate_utility(test_contract.call_view_notes(STORAGE_SLOT, ACTIVE_OR_NULLIFIED));
128122
assert_eq(retrieved, VALUE);
129123
}
130124

@@ -156,9 +150,7 @@ unconstrained fn create_partial_note_in_two_txs_and_read_in_utility() {
156150

157151
env.call_public(sender, test_contract.call_complete_partial_note(partial_note, VALUE));
158152

159-
let retrieved = env.simulate_utility(test_contract._experimental_call_view_notes(
160-
STORAGE_SLOT,
161-
ACTIVE_OR_NULLIFIED,
162-
));
153+
let retrieved =
154+
env.simulate_utility(test_contract.call_view_notes(STORAGE_SLOT, ACTIVE_OR_NULLIFIED));
163155
assert_eq(retrieved, VALUE);
164156
}

0 commit comments

Comments
 (0)