Skip to content
This repository was archived by the owner on Jul 10, 2026. It is now read-only.
Closed
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
6 changes: 3 additions & 3 deletions src/escrow_contract/src/test/withdraw.nr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use token::{test::utils as token_utils, Token};
#[test]
unconstrained fn escrow_withdraw_success() {
let escrow_secret: Field = 123456;
let (mut env, escrow_contract_address, token_contract_address, _, _, recipient, minter, logic_contract_address) =
let (env, escrow_contract_address, token_contract_address, _, _, recipient, minter, logic_contract_address) =
escrow_utils::set_escrow_with_token_and_nft(false, escrow_secret);

// Mint some tokens to escrow
Expand Down Expand Up @@ -37,7 +37,7 @@ unconstrained fn escrow_withdraw_success() {
#[test]
unconstrained fn escrow_withdraw_twice_success() {
let escrow_secret: Field = 123456;
let (mut env, escrow_contract_address, token_contract_address, _, _, recipient, minter, logic_contract_address) =
let (env, escrow_contract_address, token_contract_address, _, _, recipient, minter, logic_contract_address) =
escrow_utils::set_escrow_with_token_and_nft(false, escrow_secret);

// Mint some tokens to escrow
Expand Down Expand Up @@ -87,7 +87,7 @@ unconstrained fn escrow_withdraw_twice_success() {
#[test(should_fail_with = "Not Authorized")]
unconstrained fn escrow_withdraw_unauthorized() {
let escrow_secret: Field = 123456;
let (mut env, escrow_contract_address, token_contract_address, _, owner, recipient, _, _) =
let (env, escrow_contract_address, token_contract_address, _, owner, recipient, _, _) =
escrow_utils::set_escrow_with_token_and_nft(false, escrow_secret);

let amount: u128 = token_utils::mint_amount;
Expand Down
4 changes: 2 additions & 2 deletions src/escrow_contract/src/test/withdraw_nft.nr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use nft::{NFT, test::utils as nft_utils};
#[test]
unconstrained fn escrow_withdraw_nft_success() {
let escrow_secret: Field = 123456;
let (mut env, escrow_contract_address, _, nft_contract_address, _, recipient, minter, logic_contract_address) =
let (env, escrow_contract_address, _, nft_contract_address, _, recipient, minter, logic_contract_address) =
escrow_utils::set_escrow_with_token_and_nft(false, escrow_secret);

// Mint NFT to escrow
Expand Down Expand Up @@ -37,7 +37,7 @@ unconstrained fn escrow_withdraw_nft_success() {
#[test(should_fail_with = "Not Authorized")]
unconstrained fn escrow_withdraw_nft_unauthorized() {
let escrow_secret: Field = 123456;
let (mut env, escrow_contract_address, _, nft_contract_address, owner, recipient, _, _) =
let (env, escrow_contract_address, _, nft_contract_address, owner, recipient, _, _) =
escrow_utils::set_escrow_with_token_and_nft(false, escrow_secret);

let token_id: Field = 1;
Expand Down
10 changes: 5 additions & 5 deletions src/token_contract/src/test/burn_private.nr
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ unconstrained fn burn_private_on_behalf_of_self() {

#[test]
unconstrained fn burn_private_on_behalf_of_other() {
let (mut env, token_contract_address, owner, _, proxy) =
let (env, token_contract_address, owner, _, proxy) =
utils::setup_and_mint_to_private_with_proxy();
let burn_amount = mint_amount / 10;

Expand All @@ -48,7 +48,7 @@ unconstrained fn burn_private_on_behalf_of_other() {

#[test(should_fail_with = "Balance too low")]
unconstrained fn burn_private_failure_more_than_balance() {
let (mut env, token_contract_address, owner, _) =
let (env, token_contract_address, owner, _) =
utils::setup_and_mint_to_public_without_minter(false);

// Burn more than balance
Expand All @@ -58,7 +58,7 @@ unconstrained fn burn_private_failure_more_than_balance() {

#[test(should_fail_with = "Balance too low")]
unconstrained fn burn_private_failure_on_behalf_of_other_more_than_balance() {
let (mut env, token_contract_address, owner, _, proxy) =
let (env, token_contract_address, owner, _, proxy) =
utils::setup_and_mint_to_public_with_proxy();

// Burn more than balance
Expand All @@ -78,7 +78,7 @@ unconstrained fn burn_private_failure_on_behalf_of_other_more_than_balance() {
}
#[test(should_fail_with = "Unknown auth witness for message hash")]
unconstrained fn burn_private_failure_on_behalf_of_other_without_approval() {
let (mut env, token_contract_address, owner, _, proxy) =
let (env, token_contract_address, owner, _, proxy) =
utils::setup_and_mint_to_public_with_proxy();

// Burn more than balance
Expand All @@ -98,7 +98,7 @@ unconstrained fn burn_private_failure_on_behalf_of_other_without_approval() {

#[test(should_fail_with = "Unknown auth witness for message hash")]
unconstrained fn burn_private_failure_on_behalf_of_other_wrong_designated_caller() {
let (mut env, token_contract_address, owner, _, proxy) =
let (env, token_contract_address, owner, _, proxy) =
utils::setup_and_mint_to_public_with_proxy();

// Burn more than balance
Expand Down
12 changes: 6 additions & 6 deletions src/token_contract/src/test/burn_public.nr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use aztec::{oracle::random::random, test::helpers::authwit as authwit_cheatcodes

#[test]
unconstrained fn burn_public_success() {
let (mut env, token_contract_address, owner, _) =
let (env, token_contract_address, owner, _) =
utils::setup_and_mint_to_public_without_minter(false);
let burn_amount = mint_amount / 10 as u128;

Expand All @@ -20,7 +20,7 @@ unconstrained fn burn_public_success() {

#[test]
unconstrained fn burn_public_decrease_total_supply() {
let (mut env, token_contract_address, owner, _) =
let (env, token_contract_address, owner, _) =
utils::setup_and_mint_to_public_without_minter(false);
let burn_amount = mint_amount / 10 as u128;

Expand All @@ -39,7 +39,7 @@ unconstrained fn burn_public_decrease_total_supply() {

#[test]
unconstrained fn burn_public_on_behalf_of_other() {
let (mut env, token_contract_address, owner, recipient) =
let (env, token_contract_address, owner, recipient) =
utils::setup_and_mint_to_public_without_minter(true);
let burn_amount = mint_amount / 10 as u128;

Expand All @@ -59,7 +59,7 @@ unconstrained fn burn_public_on_behalf_of_other() {

#[test(should_fail_with = "attempt to subtract with overflow 'self.storage.public_balances.at(from).read() - amount'")]
unconstrained fn burn_public_failure_more_than_balance() {
let (mut env, token_contract_address, owner, _) =
let (env, token_contract_address, owner, _) =
utils::setup_and_mint_to_public_without_minter(false);

// Burn more than balance
Expand All @@ -70,7 +70,7 @@ unconstrained fn burn_public_failure_more_than_balance() {

#[test(should_fail_with = "unauthorized")]
unconstrained fn burn_public_failure_on_behalf_of_other_without_approval() {
let (mut env, token_contract_address, owner, recipient) =
let (env, token_contract_address, owner, recipient) =
utils::setup_and_mint_to_public_without_minter(true);

// Burn on behalf of other without approval
Expand All @@ -82,7 +82,7 @@ unconstrained fn burn_public_failure_on_behalf_of_other_without_approval() {

#[test(should_fail_with = "unauthorized")]
unconstrained fn burn_public_failure_on_behalf_of_other_wrong_caller() {
let (mut env, token_contract_address, owner, recipient) =
let (env, token_contract_address, owner, recipient) =
utils::setup_and_mint_to_public_without_minter(true);

// Burn on behalf of other, wrong designated caller
Expand Down
12 changes: 6 additions & 6 deletions src/token_contract/src/test/mint_to_commitment.nr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use aztec::oracle::random::random;
#[test]
unconstrained fn mint_to_commitment_success() {
// Setup without account contracts. We are not using authwits here, so dummy accounts are enough
let (mut env, token_contract_address, _, recipient, minter) = utils::setup_with_minter(false);
let (env, token_contract_address, _, recipient, minter) = utils::setup_with_minter(false);

let commitment = env.call_private(
minter,
Expand All @@ -25,7 +25,7 @@ unconstrained fn mint_to_commitment_success() {

#[test(should_fail_with = "caller is not minter")]
unconstrained fn mint_to_private_failure_unauthorized() {
let (mut env, token_contract_address, _, recipient, _) = utils::setup_with_minter(false);
let (env, token_contract_address, _, recipient, _) = utils::setup_with_minter(false);

let commitment = env.call_private(
recipient,
Expand All @@ -41,7 +41,7 @@ unconstrained fn mint_to_private_failure_unauthorized() {

#[test(should_fail_with = "attempt to add with overflow 'self.storage.total_supply.read() + amount'")]
unconstrained fn mint_to_private_failure_balance_overflow() {
let (mut env, token_contract_address, owner, recipient, minter) =
let (env, token_contract_address, owner, recipient, minter) =
utils::setup_with_minter(false);

let commitment = env.call_private(
Expand All @@ -67,7 +67,7 @@ unconstrained fn mint_to_private_failure_balance_overflow() {

#[test(should_fail_with = "attempt to add with overflow 'self.storage.total_supply.read() + amount'")]
unconstrained fn mint_to_private_failure_total_supply_overflow() {
let (mut env, token_contract_address, owner, recipient, minter) =
let (env, token_contract_address, owner, recipient, minter) =
utils::setup_with_minter(false);

let commitment = env.call_private(
Expand Down Expand Up @@ -97,7 +97,7 @@ unconstrained fn mint_to_private_failure_total_supply_overflow() {

#[test(should_fail_with = "Invalid partial note or completer")]
unconstrained fn mint_to_private_failure_invalid_commitments_random() {
let (mut env, token_contract_address, _, _, minter) = utils::setup_with_minter(false);
let (env, token_contract_address, _, _, minter) = utils::setup_with_minter(false);

let mint_amount: u128 = 10_000;

Expand All @@ -109,7 +109,7 @@ unconstrained fn mint_to_private_failure_invalid_commitments_random() {

#[test(should_fail_with = "Invalid partial note or completer")]
unconstrained fn mint_to_private_failure_invalid_commitments_zero() {
let (mut env, token_contract_address, _, _, minter) = utils::setup_with_minter(false);
let (env, token_contract_address, _, _, minter) = utils::setup_with_minter(false);

let mint_amount: u128 = 10_000;
env.call_public(minter, Token::at(token_contract_address).mint_to_commitment(0, mint_amount));
Expand Down
8 changes: 4 additions & 4 deletions src/token_contract/src/test/mint_to_private.nr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{test::utils, Token};
#[test]
unconstrained fn mint_to_private_success() {
// Setup without account contracts. We are not using authwits here, so dummy accounts are enough
let (mut env, token_contract_address, owner, _, minter) = utils::setup_with_minter(false);
let (env, token_contract_address, owner, _, minter) = utils::setup_with_minter(false);

let mint_amount: u128 = 10_000;
env.call_private(minter, Token::at(token_contract_address).mint_to_private(owner, mint_amount));
Expand All @@ -17,7 +17,7 @@ unconstrained fn mint_to_private_success() {
#[test(should_fail_with = "Assertion failed: caller is not minter")]
unconstrained fn mint_to_private_failure_as_non_minter() {
// Setup without account contracts. We are not using authwits here, so dummy accounts are enough
let (mut env, token_contract_address, owner, recipient, _) = utils::setup_with_minter(false);
let (env, token_contract_address, owner, recipient, _) = utils::setup_with_minter(false);

let mint_amount: u128 = 10_000;
let mint_to_private_call_interface =
Expand All @@ -28,7 +28,7 @@ unconstrained fn mint_to_private_failure_as_non_minter() {

#[test(should_fail_with = "Contract execution has reverted: Assertion failed: attempt to add with overflow 'self.storage.total_supply.read() + amount'")]
unconstrained fn mint_to_private_failure_recipient_balance_overflow() {
let (mut env, token_contract_address, owner, recipient, minter) =
let (env, token_contract_address, owner, recipient, minter) =
utils::setup_with_minter(false);
env.call_private(
minter,
Expand All @@ -41,7 +41,7 @@ unconstrained fn mint_to_private_failure_recipient_balance_overflow() {
#[test(should_fail_with = "Contract execution has reverted: Assertion failed: attempt to add with overflow 'self.storage.total_supply.read() + amount'")]
unconstrained fn mint_to_private_failure_total_supply_overflow() {
// Setup without account contracts. We are not using authwits here, so dummy accounts are enough
let (mut env, token_contract_address, owner, recipient, minter) =
let (env, token_contract_address, owner, recipient, minter) =
utils::setup_with_minter(false);

env.call_private(
Expand Down
8 changes: 4 additions & 4 deletions src/token_contract/src/test/mint_to_public.nr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{test::utils, Token};
#[test]
unconstrained fn mint_to_public_success() {
// Setup without account contracts. We are not using authwits here, so dummy accounts are enough
let (mut env, token_contract_address, owner, _, minter) = utils::setup_with_minter(false);
let (env, token_contract_address, owner, _, minter) = utils::setup_with_minter(false);

let token = Token::at(token_contract_address);

Expand All @@ -18,7 +18,7 @@ unconstrained fn mint_to_public_success() {

#[test(should_fail_with = "caller is not minter")]
unconstrained fn mint_to_public_failure_as_non_minter() {
let (mut env, token_contract_address, owner, recipient, _) = utils::setup_with_minter(false);
let (env, token_contract_address, owner, recipient, _) = utils::setup_with_minter(false);

let mint_amount: u128 = 10_000;
let mint_to_public_call_interface =
Expand All @@ -30,7 +30,7 @@ unconstrained fn mint_to_public_failure_as_non_minter() {

#[test(should_fail_with = "Contract execution has reverted: Assertion failed: attempt to add with overflow 'self.storage.public_balances.at(to).read() + amount'")]
unconstrained fn mint_to_public_failure_recipient_balance_overflow() {
let (mut env, token_contract_address, owner, recipient, minter) =
let (env, token_contract_address, owner, recipient, minter) =
utils::setup_with_minter(false);

// We have to do this in 2 steps because we have to pass in a valid u128
Expand All @@ -47,7 +47,7 @@ unconstrained fn mint_to_public_failure_recipient_balance_overflow() {
#[test(should_fail_with = "Contract execution has reverted: Assertion failed: attempt to add with overflow 'self.storage.public_balances.at(to).read() + amount'")]
unconstrained fn mint_to_public_failure_overflow_total_supply() {
// Setup without account contracts. We are not using authwits here, so dummy accounts are enough
let (mut env, token_contract_address, owner, _, minter) = utils::setup_with_minter(false);
let (env, token_contract_address, owner, _, minter) = utils::setup_with_minter(false);

let max_u128 = utils::max_u128();
let mint_to_public_call_interface =
Expand Down
4 changes: 2 additions & 2 deletions src/token_contract/src/test/transfer_private_to_commitment.nr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use generic_proxy::GenericProxy;

#[test]
unconstrained fn transfer_private_to_commitment() {
let (mut env, token_contract_address, owner, recipient) =
let (env, token_contract_address, owner, recipient) =
utils::setup_and_mint_to_private_without_minter(false);

utils::check_private_balance(env, token_contract_address, owner, mint_amount);
Expand Down Expand Up @@ -36,7 +36,7 @@ unconstrained fn transfer_private_to_commitment() {

#[test]
unconstrained fn transfer_private_to_commitment_on_behalf_of_other() {
let (mut env, token_contract_address, owner, recipient, proxy) =
let (env, token_contract_address, owner, recipient, proxy) =
utils::setup_and_mint_to_private_with_proxy();

utils::check_private_balance(env, token_contract_address, owner, mint_amount);
Expand Down
12 changes: 6 additions & 6 deletions src/token_contract/src/test/transfer_private_to_private.nr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use uint_note::UintNote;
#[test]
unconstrained fn transfer_private_on_behalf_of_other() {
// Setup with account contracts. Slower since we actually deploy them, but needed for authwits.
let (mut env, token_contract_address, owner, recipient, proxy) =
let (env, token_contract_address, owner, recipient, proxy) =
utils::setup_and_mint_to_private_with_proxy();
// Add authwit
let transfer_amount = (1000 as u128);
Expand Down Expand Up @@ -40,7 +40,7 @@ unconstrained fn transfer_private_on_behalf_of_other() {

#[test]
unconstrained fn transfer_private_zero_amount() {
let (mut env, token_contract_address, owner, recipient) =
let (env, token_contract_address, owner, recipient) =
utils::setup_and_mint_to_private_without_minter(false);

env.call_private(
Expand All @@ -56,7 +56,7 @@ unconstrained fn transfer_private_zero_amount() {
#[test]
unconstrained fn transfer_private_multiple_notes_recursively() {
// Setup with account contracts. Slower since we actually deploy them, but needed for authwits.
let (mut env, token_contract_address, owner, recipient, minter) =
let (env, token_contract_address, owner, recipient, minter) =
utils::setup_with_minter(true);

let notes_amount: u128 = 1000;
Expand Down Expand Up @@ -105,7 +105,7 @@ unconstrained fn transfer_private_multiple_notes_recursively() {
#[test(should_fail_with = "Balance too low")]
unconstrained fn transfer_private_failure_on_behalf_of_more_than_balance() {
// Setup with account contracts. Slower since we actually deploy them, but needed for authwits.
let (mut env, token_contract_address, owner, recipient, proxy) =
let (env, token_contract_address, owner, recipient, proxy) =
utils::setup_and_mint_to_private_with_proxy();
// Add authwit
let transfer_amount = mint_amount + (1 as u128);
Expand All @@ -132,7 +132,7 @@ unconstrained fn transfer_private_failure_on_behalf_of_more_than_balance() {
#[test(should_fail_with = "Unknown auth witness for message hash ")]
unconstrained fn transfer_private_failure_on_behalf_of_other_without_approval() {
// Setup with account contracts. Slower since we actually deploy them, but needed for authwits.
let (mut env, token_contract_address, owner, recipient, proxy) =
let (env, token_contract_address, owner, recipient, proxy) =
utils::setup_and_mint_to_private_with_proxy();
// No authwit added
let transfer_amount = (1000 as u128);
Expand All @@ -152,7 +152,7 @@ unconstrained fn transfer_private_failure_on_behalf_of_other_without_approval()
#[test(should_fail_with = "Unknown auth witness for message hash")]
unconstrained fn transfer_private_failure_on_behalf_of_other_wrong_caller() {
// Setup with account contracts. Slower since we actually deploy them, but needed for authwits.
let (mut env, token_contract_address, owner, recipient, proxy) =
let (env, token_contract_address, owner, recipient, proxy) =
utils::setup_and_mint_to_private_with_proxy();
// Add authwit
let transfer_amount: u128 = 1000;
Expand Down
Loading
Loading