diff --git a/avm-transpiler/scripts/compile_then_transpile.sh b/avm-transpiler/scripts/compile_then_transpile.sh index d9008cc101c..21c4ab486b6 100755 --- a/avm-transpiler/scripts/compile_then_transpile.sh +++ b/avm-transpiler/scripts/compile_then_transpile.sh @@ -18,7 +18,7 @@ fi shift # remove the compile arg so we can inject --show-artifact-paths # Forward all arguments to nargo, tee output to console -artifacts_to_transpile=$($NARGO compile --use-legacy --show-artifact-paths $@ | tee /dev/tty | grep -oP 'Saved contract artifact to: \K.*') +artifacts_to_transpile=$($NARGO compile --show-artifact-paths $@ | tee /dev/tty | grep -oP 'Saved contract artifact to: \K.*') # NOTE: the output that is teed to /dev/tty will normally not be redirectable by the caller. # If the script is run via docker, however, the user will see this output on stdout and will be able to redirect. diff --git a/aztec-up/bin/aztec b/aztec-up/bin/aztec index 6f2ed002fa6..b25e54f545e 100755 --- a/aztec-up/bin/aztec +++ b/aztec-up/bin/aztec @@ -16,7 +16,7 @@ if [ "${1:-}" == "test" ]; then # Compose file to use FILE_ARG="-f $HOME/.aztec/docker-compose.test.yml" # Aztec contract test args for nargo - TEST_ARGS="$@ --silence-warnings --use-legacy --oracle-resolver http://aztec:8081" + TEST_ARGS="$@ --silence-warnings --oracle-resolver http://aztec:8081" get_compose -p aztec-test $FILE_ARG run -e NARGO_FOREIGN_CALL_TIMEOUT=300000 --workdir $CALLED_FROM --rm -it aztec-nargo $TEST_ARGS elif [ $# == 2 ] && [ "$1" == "start" ] && [ "$2" == "--sandbox" ]; then # Change working dir, so relative volume mounts are in the right place. diff --git a/boxes/boxes/react/package.json b/boxes/boxes/react/package.json index ddf98a6fef8..8e574163eb5 100644 --- a/boxes/boxes/react/package.json +++ b/boxes/boxes/react/package.json @@ -6,7 +6,7 @@ "type": "module", "main": "./dist/index.js", "scripts": { - "compile": "cd src/contracts && ${AZTEC_NARGO:-aztec-nargo} compile --use-legacy --silence-warnings", + "compile": "cd src/contracts && ${AZTEC_NARGO:-aztec-nargo} compile --silence-warnings", "codegen": "${AZTEC_BUILDER:-aztec-builder} codegen src/contracts/target -o artifacts", "clean": "rm -rf ./dist .tsbuildinfo ./artifacts ./src/contracts/target", "prep": "yarn clean && yarn compile && yarn codegen", diff --git a/boxes/boxes/vanilla/package.json b/boxes/boxes/vanilla/package.json index f590df2b6d3..045d0e976fa 100644 --- a/boxes/boxes/vanilla/package.json +++ b/boxes/boxes/vanilla/package.json @@ -5,7 +5,7 @@ "version": "0.1.0", "type": "module", "scripts": { - "compile": "cd src/contracts && ${AZTEC_NARGO:-aztec-nargo} compile --use-legacy --silence-warnings", + "compile": "cd src/contracts && ${AZTEC_NARGO:-aztec-nargo} compile --silence-warnings", "codegen": "${AZTEC_BUILDER:-aztec-builder} codegen src/contracts/target -o artifacts", "clean": "rm -rf ./dest .tsbuildinfo ./artifacts ./src/contracts/target", "prep": "yarn clean && yarn compile && yarn codegen && tsc -b", diff --git a/docs/docs/migration_notes.md b/docs/docs/migration_notes.md index bb7057511ee..e7282188110 100644 --- a/docs/docs/migration_notes.md +++ b/docs/docs/migration_notes.md @@ -21,7 +21,7 @@ Sandbox commands have been cleaned up and simplified. Doing `aztec-up` now gets **ADDED**: -* `aztec test [options]`: runs `aztec start --txe && aztec-nargo test --use-legacy --oracle-resolver http://aztec:8081 --silence-warnings [options]` via docker-compose allowing users to easily run contract tests using TXE +* `aztec test [options]`: runs `aztec start --txe && aztec-nargo test --oracle-resolver http://aztec:8081 --silence-warnings [options]` via docker-compose allowing users to easily run contract tests using TXE ## 0.45.0 ### [Aztec.nr] Remove unencrypted logs from private diff --git a/noir-projects/Dockerfile b/noir-projects/Dockerfile index afc9663888c..5b28c93811a 100644 --- a/noir-projects/Dockerfile +++ b/noir-projects/Dockerfile @@ -22,7 +22,7 @@ RUN ./bootstrap.sh WORKDIR /usr/src/noir-projects/noir-protocol-circuits RUN ./bootstrap.sh WORKDIR /usr/src/noir-projects/aztec-nr -RUN nargo compile --use-legacy --silence-warnings +RUN nargo compile --silence-warnings FROM scratch COPY --from=builder /usr/src/noir-projects /usr/src/noir-projects \ No newline at end of file diff --git a/noir-projects/Dockerfile.test b/noir-projects/Dockerfile.test index a62829b1945..717d2b4deb9 100644 --- a/noir-projects/Dockerfile.test +++ b/noir-projects/Dockerfile.test @@ -22,7 +22,7 @@ WORKDIR /usr/src/noir-projects COPY . . # Build & test -RUN cd ./noir-protocol-circuits && ./bootstrap.sh && nargo test --use-legacy --silence-warnings +RUN cd ./noir-protocol-circuits && ./bootstrap.sh && nargo test --silence-warnings RUN cd /usr/src/yarn-project/txe && yarn start & \ # Wait for TXE to initialize @@ -31,10 +31,10 @@ RUN cd /usr/src/yarn-project/txe && yarn start & \ # We need to increase the timeout since all tests running in parallel hammer TXE at the same time, and processing slows down leading to timeouts # The only way we currently have to batch tests is via RAYON_NUM_THREADS, which is not ideal ./bootstrap.sh && \ - NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --use-legacy --silence-warnings --oracle-resolver http://localhost:8080 + NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --silence-warnings --oracle-resolver http://localhost:8080 RUN cd /usr/src/yarn-project/txe && yarn start & \ # Wait for TXE to initialize sleep 5 && \ cd ./aztec-nr && \ - NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --use-legacy --silence-warnings --oracle-resolver http://localhost:8080 \ No newline at end of file + NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --silence-warnings --oracle-resolver http://localhost:8080 \ No newline at end of file diff --git a/noir-projects/Earthfile b/noir-projects/Earthfile index f1b254c3dfc..3263e5248ab 100644 --- a/noir-projects/Earthfile +++ b/noir-projects/Earthfile @@ -60,7 +60,7 @@ test: # Wait for TXE to initialize sleep 5 && \ cd /usr/src/noir-projects/aztec-nr && \ - NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --use-legacy --silence-warnings --oracle-resolver http://localhost:8080 + NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --silence-warnings --oracle-resolver http://localhost:8080 RUN cd /usr/src/yarn-project/txe && yarn start & \ # Wait for TXE to initialize @@ -68,7 +68,7 @@ test: cd /usr/src/noir-projects/noir-contracts && \ # We need to increase the timeout since all tests running in parallel hammer TXE at the same time and processing slows down, leading to timeouts # The only way we currently have to batch tests is via RAYON_NUM_THREADS, which is not ideal - NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --use-legacy --silence-warnings --oracle-resolver http://localhost:8080 + NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --silence-warnings --oracle-resolver http://localhost:8080 format: FROM +build diff --git a/noir-projects/noir-contracts/bootstrap.sh b/noir-projects/noir-contracts/bootstrap.sh index 19de570b329..3eb62c4530f 100755 --- a/noir-projects/noir-contracts/bootstrap.sh +++ b/noir-projects/noir-contracts/bootstrap.sh @@ -17,7 +17,7 @@ fi echo "Compiling contracts..." NARGO=${NARGO:-../../noir/noir-repo/target/release/nargo} -$NARGO compile --silence-warnings --use-legacy +$NARGO compile --silence-warnings echo "Transpiling contracts..." scripts/transpile.sh \ No newline at end of file diff --git a/noir-projects/noir-protocol-circuits/bootstrap.sh b/noir-projects/noir-protocol-circuits/bootstrap.sh index 155bc7948cf..fca6dd29e0f 100755 --- a/noir-projects/noir-protocol-circuits/bootstrap.sh +++ b/noir-projects/noir-protocol-circuits/bootstrap.sh @@ -20,7 +20,7 @@ node ./generate_variants.js echo "Compiling protocol circuits..." NARGO=${NARGO:-../../noir/noir-repo/target/release/nargo} -$NARGO compile --silence-warnings --use-legacy +$NARGO compile --silence-warnings BB_HASH=${BB_HASH:-$(cd ../../ && git ls-tree -r HEAD | grep 'barretenberg/cpp' | awk '{print $3}' | git hash-object --stdin)} echo Using BB hash $BB_HASH diff --git a/noir/noir-repo/aztec_macros/src/transforms/contract_interface.rs b/noir/noir-repo/aztec_macros/src/transforms/contract_interface.rs index e79cee66407..56107de77c5 100644 --- a/noir/noir-repo/aztec_macros/src/transforms/contract_interface.rs +++ b/noir/noir-repo/aztec_macros/src/transforms/contract_interface.rs @@ -1,15 +1,18 @@ +use acvm::acir::AcirField; + use noirc_errors::Location; use noirc_frontend::ast::{Ident, NoirFunction, UnresolvedTypeData}; use noirc_frontend::{ graph::CrateId, - macros_api::{FileId, HirContext, HirExpression, HirLiteral, HirStatement}, + macros_api::{FieldElement, FileId, HirContext, HirExpression, HirLiteral, HirStatement}, parse_program, parser::SortedModule, Type, }; +use tiny_keccak::{Hasher, Keccak}; + use crate::utils::{ - constants::SELECTOR_PLACEHOLDER, errors::AztecMacroError, hir_utils::{collect_crate_structs, get_contract_module_data, signature_of_type}, }; @@ -64,11 +67,6 @@ pub fn stub_function(aztec_visibility: &str, func: &NoirFunction, is_static_call .join(", "); let fn_return_type: noirc_frontend::ast::UnresolvedType = func.return_type(); - let fn_selector = format!( - "dep::aztec::protocol_types::abis::function_selector::FunctionSelector::from_signature(\"{}\")", - SELECTOR_PLACEHOLDER - ); - let parameters = func.parameters(); let is_void = if matches!(fn_return_type.typ, UnresolvedTypeData::Unit) { "Void" } else { "" }; let is_static = if is_static_call { "Static" } else { "" }; @@ -160,7 +158,7 @@ pub fn stub_function(aztec_visibility: &str, func: &NoirFunction, is_static_call let fn_body = format!( "{} - let selector = {}; + let selector = dep::aztec::protocol_types::abis::function_selector::FunctionSelector::from_field(0); dep::aztec::context::{}{}{}CallInterface {{ target_contract: self.target_contract, selector, @@ -172,7 +170,6 @@ pub fn stub_function(aztec_visibility: &str, func: &NoirFunction, is_static_call {} }}", args, - fn_selector, aztec_visibility, is_static, is_void, @@ -291,27 +288,34 @@ pub fn generate_contract_interface( Ok(()) } -fn compute_fn_signature(fn_name: &str, parameters: &[Type]) -> String { - format!( +fn compute_fn_signature_hash(fn_name: &str, parameters: &[Type]) -> u32 { + let signature = format!( "{}({})", fn_name, parameters.iter().map(signature_of_type).collect::>().join(",") - ) + ); + let mut keccak = Keccak::v256(); + let mut result = [0u8; 32]; + keccak.update(signature.as_bytes()); + keccak.finalize(&mut result); + // Take the first 4 bytes of the hash and convert them to an integer + // If you change the following value you have to change NUM_BYTES_PER_NOTE_TYPE_ID in l1_note_payload.ts as well + let num_bytes_per_note_type_id = 4; + u32::from_be_bytes(result[0..num_bytes_per_note_type_id].try_into().unwrap()) } // Updates the function signatures in the contract interface with the actual ones, replacing the placeholder. -// This is done by locating the contract interface struct, its functions (stubs) and assuming the last statement of each -// is the constructor for a CallInterface. This constructor has a selector field that holds a -// FunctionSelector::from_signature function that receives the signature as a string literal. +// This is done by locating the contract interface struct, its functions (stubs) and assuming the second to last statement of each +// is a let statement initializing the selector with a FunctionSelector::from_field call. pub fn update_fn_signatures_in_contract_interface( crate_id: &CrateId, context: &mut HirContext, ) -> Result<(), (AztecMacroError, FileId)> { - if let Some((name, _, file_id)) = get_contract_module_data(context, crate_id) { + if let Some((struct_name, _, file_id)) = get_contract_module_data(context, crate_id) { let maybe_interface_struct = collect_crate_structs(crate_id, context).iter().find_map(|struct_id| { let r#struct = context.def_interner.get_struct(*struct_id); - if r#struct.borrow().name.0.contents == name { + if r#struct.borrow().name.0.contents == struct_name { Some(r#struct) } else { None @@ -329,7 +333,7 @@ pub fn update_fn_signatures_in_contract_interface( continue; } - let fn_signature = compute_fn_signature( + let fn_signature_hash = compute_fn_signature_hash( name, &fn_parameters .iter() @@ -381,14 +385,12 @@ pub fn update_fn_signatures_in_contract_interface( context.def_interner.expression(¤t_fn_signature_expression_id); match current_fn_signature_expression { - HirExpression::Literal(HirLiteral::Str(signature)) => { - if signature != SELECTOR_PLACEHOLDER { + HirExpression::Literal(HirLiteral::Integer(value, _)) => { + if !value.is_zero() { Err(( AztecMacroError::CouldNotGenerateContractInterface { - secondary_message: Some(format!( - "Function signature argument must be a placeholder: {}", - SELECTOR_PLACEHOLDER - )), + secondary_message: Some( + "Function signature argument must be a placeholder with value 0".to_string()), }, file_id, )) @@ -397,20 +399,25 @@ pub fn update_fn_signatures_in_contract_interface( } } _ => Err(( - AztecMacroError::CouldNotAssignStorageSlots { + AztecMacroError::CouldNotGenerateContractInterface { secondary_message: Some( - "Function signature argument must be a literal string".to_string(), + "Function signature argument must be a literal field element" + .to_string(), ), }, file_id, )), }?; - context - .def_interner - .update_expression(current_fn_signature_expression_id, |expr| { - *expr = HirExpression::Literal(HirLiteral::Str(fn_signature)) - }); + context.def_interner.update_expression( + current_fn_signature_expression_id, + |expr| { + *expr = HirExpression::Literal(HirLiteral::Integer( + FieldElement::from(fn_signature_hash as u128), + false, + )) + }, + ); } } } diff --git a/noir/noir-repo/aztec_macros/src/transforms/note_interface.rs b/noir/noir-repo/aztec_macros/src/transforms/note_interface.rs index 49525fc2ae1..1369e6515b7 100644 --- a/noir/noir-repo/aztec_macros/src/transforms/note_interface.rs +++ b/noir/noir-repo/aztec_macros/src/transforms/note_interface.rs @@ -100,7 +100,9 @@ pub fn generate_note_interface_impl(module: &mut SortedModule) -> Result<(), Azt }) .collect::, _>>()?; let [note_serialized_len, note_bytes_len]: [_; 2] = - note_interface_generics.try_into().unwrap(); + note_interface_generics.try_into().expect( + "NoteInterface must be generic over 2 types, NOTE_FIELDS_LEN and NOTE_BYTES_LEN", + ); // Automatically inject the header field if it's not present let (header_field_name, _) = if let Some(existing_header) = diff --git a/noir/noir-repo/aztec_macros/src/utils/constants.rs b/noir/noir-repo/aztec_macros/src/utils/constants.rs index 2178f7a2526..3e93b2aa545 100644 --- a/noir/noir-repo/aztec_macros/src/utils/constants.rs +++ b/noir/noir-repo/aztec_macros/src/utils/constants.rs @@ -1,3 +1,2 @@ pub const FUNCTION_TREE_HEIGHT: u32 = 5; pub const MAX_CONTRACT_PRIVATE_FUNCTIONS: usize = 2_usize.pow(FUNCTION_TREE_HEIGHT); -pub const SELECTOR_PLACEHOLDER: &str = "SELECTOR_PLACEHOLDER"; diff --git a/yarn-project/aztec/src/cli/cli.ts b/yarn-project/aztec/src/cli/cli.ts index 03b79596915..35bb29f19f2 100644 --- a/yarn-project/aztec/src/cli/cli.ts +++ b/yarn-project/aztec/src/cli/cli.ts @@ -112,8 +112,8 @@ export function injectAztecCommands(program: Command, userLog: LogFn, debugLogge test [options]: starts a dockerized TXE node via $ aztec start --txe - then runs - $ aztec-nargo test --silence-warnings --use-legacy --oracle-resolver= [options] + then runs + $ aztec-nargo test --silence-warnings --oracle-resolver= [options] `, ); diff --git a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/access_control.test.ts b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/access_control.test.ts index 4c1400caffe..5167717d5b3 100644 --- a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/access_control.test.ts +++ b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/access_control.test.ts @@ -73,14 +73,14 @@ describe('e2e_blacklist_token_contract access control', () => { const newRole = new Role().withAdmin().withAdmin(); await expect( t.asset.withWallet(t.other).methods.update_roles(AztecAddress.random(), newRole.toNoirStruct()).prove(), - ).rejects.toThrow("Assertion failed: caller is not admin 'caller_roles.is_admin'"); + ).rejects.toThrow(/Assertion failed: caller is not admin .*/); }); it('revoke minter from non admin', async () => { const noRole = new Role(); await expect( t.asset.withWallet(t.other).methods.update_roles(t.admin.getAddress(), noRole.toNoirStruct()).prove(), - ).rejects.toThrow("Assertion failed: caller is not admin 'caller_roles.is_admin'"); + ).rejects.toThrow(/Assertion failed: caller is not admin .*/); }); }); }); diff --git a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/burn.test.ts b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/burn.test.ts index 6c6d95ab7be..bd77461fa84 100644 --- a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/burn.test.ts +++ b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/burn.test.ts @@ -112,7 +112,7 @@ describe('e2e_blacklist_token_contract burn', () => { it('burn from blacklisted account', async () => { await expect(asset.methods.burn_public(blacklisted.getAddress(), 1n, 0).prove()).rejects.toThrow( - "Assertion failed: Blacklisted: Sender '!from_roles.is_blacklisted'", + /Assertion failed: Blacklisted: Sender/, ); }); }); @@ -224,7 +224,7 @@ describe('e2e_blacklist_token_contract burn', () => { it('burn from blacklisted account', async () => { await expect(asset.methods.burn(blacklisted.getAddress(), 1n, 0).prove()).rejects.toThrow( - "Assertion failed: Blacklisted: Sender '!from_roles.is_blacklisted'", + /Assertion failed: Blacklisted: Sender .*/, ); }); }); diff --git a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/minting.test.ts b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/minting.test.ts index b3b7eef247d..6c7d700364c 100644 --- a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/minting.test.ts +++ b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/minting.test.ts @@ -67,7 +67,7 @@ describe('e2e_blacklist_token_contract mint', () => { it('mint to blacklisted entity', async () => { await expect( asset.withWallet(wallets[1]).methods.mint_public(blacklisted.getAddress(), 1n).prove(), - ).rejects.toThrow("Assertion failed: Blacklisted: Recipient '!to_roles.is_blacklisted'"); + ).rejects.toThrow(/Assertion failed: Blacklisted: Recipient/); }); }); }); @@ -139,7 +139,7 @@ describe('e2e_blacklist_token_contract mint', () => { it('mint and try to redeem at blacklist', async () => { await expect(asset.methods.redeem_shield(blacklisted.getAddress(), amount, secret).prove()).rejects.toThrow( - "Assertion failed: Blacklisted: Recipient '!to_roles.is_blacklisted'", + /Assertion failed: Blacklisted: Recipient .*/, ); }); }); diff --git a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/shielding.test.ts b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/shielding.test.ts index 8898eb47798..de9a3e1529d 100644 --- a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/shielding.test.ts +++ b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/shielding.test.ts @@ -135,7 +135,7 @@ describe('e2e_blacklist_token_contract shield + redeem_shield', () => { it('shielding from blacklisted account', async () => { await expect( asset.withWallet(blacklisted).methods.shield(blacklisted.getAddress(), 1n, secretHash, 0).prove(), - ).rejects.toThrow("Assertion failed: Blacklisted: Sender '!from_roles.is_blacklisted'"); + ).rejects.toThrow(/Assertion failed: Blacklisted: Sender .*/); }); }); }); diff --git a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_private.test.ts b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_private.test.ts index 75f8c919bad..88c74d23676 100644 --- a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_private.test.ts +++ b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_private.test.ts @@ -170,13 +170,13 @@ describe('e2e_blacklist_token_contract transfer private', () => { it('transfer from a blacklisted account', async () => { await expect( asset.methods.transfer(blacklisted.getAddress(), wallets[0].getAddress(), 1n, 0).prove(), - ).rejects.toThrow("Assertion failed: Blacklisted: Sender '!from_roles.is_blacklisted'"); + ).rejects.toThrow(/Assertion failed: Blacklisted: Sender .*/); }); it('transfer to a blacklisted account', async () => { await expect( asset.methods.transfer(wallets[0].getAddress(), blacklisted.getAddress(), 1n, 0).prove(), - ).rejects.toThrow("Assertion failed: Blacklisted: Recipient '!to_roles.is_blacklisted'"); + ).rejects.toThrow(/Assertion failed: Blacklisted: Recipient .*/); }); }); }); diff --git a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_public.test.ts b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_public.test.ts index b1854b7677b..58d2d762fa2 100644 --- a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_public.test.ts +++ b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_public.test.ts @@ -153,13 +153,13 @@ describe('e2e_blacklist_token_contract transfer public', () => { it('transfer from a blacklisted account', async () => { await expect( asset.methods.transfer_public(blacklisted.getAddress(), wallets[0].getAddress(), 1n, 0n).prove(), - ).rejects.toThrow("Assertion failed: Blacklisted: Sender '!from_roles.is_blacklisted'"); + ).rejects.toThrow(/Assertion failed: Blacklisted: Sender .*/); }); it('transfer to a blacklisted account', async () => { await expect( asset.methods.transfer_public(wallets[0].getAddress(), blacklisted.getAddress(), 1n, 0n).prove(), - ).rejects.toThrow("Assertion failed: Blacklisted: Recipient '!to_roles.is_blacklisted'"); + ).rejects.toThrow(/Assertion failed: Blacklisted: Recipient .*/); }); }); }); diff --git a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/unshielding.test.ts b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/unshielding.test.ts index 4d877859f53..f00aa0bdbbe 100644 --- a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/unshielding.test.ts +++ b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/unshielding.test.ts @@ -130,13 +130,13 @@ describe('e2e_blacklist_token_contract unshielding', () => { it('unshield from blacklisted account', async () => { await expect( asset.methods.unshield(blacklisted.getAddress(), wallets[0].getAddress(), 1n, 0).prove(), - ).rejects.toThrow("Assertion failed: Blacklisted: Sender '!from_roles.is_blacklisted'"); + ).rejects.toThrow(/Assertion failed: Blacklisted: Sender .*/); }); it('unshield to blacklisted account', async () => { await expect( asset.methods.unshield(wallets[0].getAddress(), blacklisted.getAddress(), 1n, 0).prove(), - ).rejects.toThrow("Assertion failed: Blacklisted: Recipient '!to_roles.is_blacklisted'"); + ).rejects.toThrow(/Assertion failed: Blacklisted: Recipient .*/); }); }); });