diff --git a/forc-plugins/forc-client/tests/deploy.rs b/forc-plugins/forc-client/tests/deploy.rs index 9f98e42c33..a2c452c66e 100644 --- a/forc-plugins/forc-client/tests/deploy.rs +++ b/forc-plugins/forc-client/tests/deploy.rs @@ -377,7 +377,7 @@ async fn test_simple_deploy() { node.kill().unwrap(); let expected = vec![DeployedPackage::Contract(DeployedContract { id: ContractId::from_str( - "e6a03496312ff25990b73489e9ef253d20e2fd09701371d64ec54c9fb31516ae", + "440b559604961bdbeaa31421823f34e45d246b5d139aa4886e5e1cf2901fc925", ) .unwrap(), proxy: None, @@ -421,7 +421,7 @@ async fn test_deploy_submit_only() { node.kill().unwrap(); let expected = vec![DeployedPackage::Contract(DeployedContract { id: ContractId::from_str( - "e6a03496312ff25990b73489e9ef253d20e2fd09701371d64ec54c9fb31516ae", + "440b559604961bdbeaa31421823f34e45d246b5d139aa4886e5e1cf2901fc925", ) .unwrap(), proxy: None, @@ -468,12 +468,12 @@ async fn test_deploy_fresh_proxy() { node.kill().unwrap(); let impl_contract = DeployedPackage::Contract(DeployedContract { id: ContractId::from_str( - "e6a03496312ff25990b73489e9ef253d20e2fd09701371d64ec54c9fb31516ae", + "440b559604961bdbeaa31421823f34e45d246b5d139aa4886e5e1cf2901fc925", ) .unwrap(), proxy: Some( ContractId::from_str( - "b5a98fd0d185284ee0775c9872d342914f0934ed479884096fe7bbd2c0b6aca7", + "19d465200575ebd085300242002efcda38db99e22449a5c1346588efe9ced7f7", ) .unwrap(), ), diff --git a/forc/tests/cli_integration.rs b/forc/tests/cli_integration.rs index b3e5d99519..02f63a319e 100644 --- a/forc/tests/cli_integration.rs +++ b/forc/tests/cli_integration.rs @@ -51,10 +51,10 @@ fn test_forc_test_raw_logs() -> Result<(), rexpect::error::Error> { // Assert that the output is correct process.exp_string(" test test_log_4")?; process.exp_string("raw logs:")?; - process.exp_string(r#"[{"LogData":{"data":"0000000000000004","digest":"8005f02d43fa06e7d0585fb64c961d57e318b27a145c857bcd3a6bdb413ff7fc","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12460,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?; + process.exp_string(r#"[{"LogData":{"data":"0000000000000004","digest":"8005f02d43fa06e7d0585fb64c961d57e318b27a145c857bcd3a6bdb413ff7fc","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12456,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?; process.exp_string(" test test_log_2")?; process.exp_string("raw logs:")?; - process.exp_string(r#"[{"LogData":{"data":"0000000000000002","digest":"cd04a4754498e06db5a13c5f371f1f04ff6d2470f24aa9bd886540e5dce77f70","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12460,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?; + process.exp_string(r#"[{"LogData":{"data":"0000000000000002","digest":"cd04a4754498e06db5a13c5f371f1f04ff6d2470f24aa9bd886540e5dce77f70","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12456,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?; process.process.exit()?; Ok(()) @@ -77,12 +77,12 @@ fn test_forc_test_both_logs() -> Result<(), rexpect::error::Error> { process.exp_string("decoded log values:")?; process.exp_string("4, log rb: 1515152261580153489")?; process.exp_string("raw logs:")?; - process.exp_string(r#"[{"LogData":{"data":"0000000000000004","digest":"8005f02d43fa06e7d0585fb64c961d57e318b27a145c857bcd3a6bdb413ff7fc","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12460,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?; + process.exp_string(r#"[{"LogData":{"data":"0000000000000004","digest":"8005f02d43fa06e7d0585fb64c961d57e318b27a145c857bcd3a6bdb413ff7fc","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12456,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?; process.exp_string(" test test_log_2")?; process.exp_string("decoded log values:")?; process.exp_string("2, log rb: 1515152261580153489")?; process.exp_string("raw logs:")?; - process.exp_string(r#"[{"LogData":{"data":"0000000000000002","digest":"cd04a4754498e06db5a13c5f371f1f04ff6d2470f24aa9bd886540e5dce77f70","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12460,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?; + process.exp_string(r#"[{"LogData":{"data":"0000000000000002","digest":"cd04a4754498e06db5a13c5f371f1f04ff6d2470f24aa9bd886540e5dce77f70","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12456,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?; process.process.exit()?; Ok(()) } diff --git a/sway-core/src/ir_generation/function.rs b/sway-core/src/ir_generation/function.rs index 1f098fceea..ed6825436f 100644 --- a/sway-core/src/ir_generation/function.rs +++ b/sway-core/src/ir_generation/function.rs @@ -187,14 +187,16 @@ fn calc_addr_as_ptr( assert!(ptr.get_type(context).unwrap().is_ptr(context)); assert!(len.get_type(context).unwrap().is_uint64(context)); - let uint64 = Type::get_uint64(context); - let ptr = current_block.append(context).ptr_to_int(ptr, uint64); let addr = current_block .append(context) .binary_op(BinaryOpKind::Add, ptr, len); + // cast the addr to ptr_to let ptr_to = Type::new_typed_pointer(context, ptr_to); - current_block.append(context).int_to_ptr(addr, ptr_to) + current_block + .append(context) + .cast_ptr(addr, ptr_to) + .add_metadatum(context, None) } impl<'a> FnCompiler<'a> { @@ -450,17 +452,18 @@ impl<'a> FnCompiler<'a> { string_len: u64, ) -> Result { let int_ty = Type::get_uint64(context); + let ptr_ty = Type::get_ptr(context); // build field values of the slice let ptr_val = self .current_block .append(context) - .ptr_to_int(string_data, int_ty) + .cast_ptr(string_data, ptr_ty) .add_metadatum(context, span_md_idx); let len_val = ConstantContent::get_uint(context, 64, string_len); // a slice is a pointer and a length - let field_types = vec![int_ty, int_ty]; + let field_types = vec![ptr_ty, int_ty]; // build a struct variable to store the values let struct_type = Type::new_struct(context, field_types.clone()); @@ -1777,16 +1780,15 @@ impl<'a> FnCompiler<'a> { immediate: None, metadata: None, }]; + + let ptr_ty = Type::get_ptr(context); let ptr = self.current_block.append(context).asm_block( args, body, - uint64, + ptr_ty, Some(Ident::new_no_span("hp".into())), ); - let ptr_ty = Type::get_ptr(context); - let ptr = self.current_block.append(context).int_to_ptr(ptr, ptr_ty); - let len = ConstantContent::new_uint(context, 64, 0); let len_c = Constant::unique(context, len); let len = Value::new_constant(context, len_c); @@ -2353,13 +2355,13 @@ impl<'a> FnCompiler<'a> { ) .expect_register(); - let uint64 = Type::get_uint64(context); + let uint64_ty = Type::get_uint64(context); + let ptr_ty = Type::get_ptr(context); let (ptr, _, len) = self.compile_buffer_into_parts(context, buffer)?; - let ptr = self.current_block.append(context).ptr_to_int(ptr, uint64); let slice_as_tuple = self.compile_tuple_from_values( context, vec![ptr, len], - vec![uint64, uint64], + vec![ptr_ty, uint64_ty], None, )?; diff --git a/sway-ir/src/analysis.rs b/sway-ir/src/analysis.rs index 47ff44f2d5..8e7ed94489 100644 --- a/sway-ir/src/analysis.rs +++ b/sway-ir/src/analysis.rs @@ -4,3 +4,5 @@ pub mod dominator; pub use dominator::*; pub mod memory_utils; pub use memory_utils::*; +pub mod arg_mutability; +pub use arg_mutability::*; diff --git a/sway-ir/src/analysis/arg_mutability.rs b/sway-ir/src/analysis/arg_mutability.rs new file mode 100644 index 0000000000..c87c5cdd79 --- /dev/null +++ b/sway-ir/src/analysis/arg_mutability.rs @@ -0,0 +1,62 @@ +//! For every function argument that is a pointer, determine if that function +//! may mutate the corresponding pointee. + +use rustc_hash::FxHashMap; + +use crate::{ + build_call_graph, callee_first_order, AnalysisResult, AnalysisResultT, AnalysisResults, + Context, Function, IrError, Module, Pass, PassMutability, ScopedPass, +}; + +#[derive(Debug, Clone)] +/// The mutability of a pointer function argument's pointee. +pub enum ArgPointeeMutability { + Immutable, + Mutable, + NotAPointer, +} + +// The dominator tree is represented by mapping each Block to its DomTreeNode. +#[derive(Default)] +pub struct ArgPointeeMutabilityResult(FxHashMap>); +impl AnalysisResultT for ArgPointeeMutabilityResult {} + +pub const ARG_POINTEE_MUTABILITY_NAME: &str = "arg_pointee_mutability"; + +pub fn create_arg_pointee_mutability_pass() -> Pass { + Pass { + name: ARG_POINTEE_MUTABILITY_NAME, + descr: "Analyze the mutability of function argument pointees", + deps: vec![], + runner: ScopedPass::ModulePass(PassMutability::Analysis( + compute_arg_pointee_mutability_pass, + )), + } +} + +impl ArgPointeeMutabilityResult { + /// Get the mutability of the pointee for a function argument. + /// Panics on invalid function or argument index. + pub fn get_mutability(&self, function: Function, arg_index: usize) -> ArgPointeeMutability { + self.0.get(&function).unwrap()[arg_index].clone() + } +} + +pub fn compute_arg_pointee_mutability_pass( + context: &Context, + _: &AnalysisResults, + module: Module, +) -> Result { + Ok(Box::new(compute_arg_pointee_mutability(context, module))) +} + +/// Compute the mutability of function argument pointees. +pub fn compute_arg_pointee_mutability( + context: &Context, + module: Module, +) -> ArgPointeeMutabilityResult { + let cg = build_call_graph(context, &context.modules.get(module.0).unwrap().functions); + let _callee_first = callee_first_order(&cg); + + todo!() +} diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_dedup_decode/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_dedup_decode/stdout.snap index 76456154f3..a7ede9dc29 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_dedup_decode/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_dedup_decode/stdout.snap @@ -68,7 +68,7 @@ script { local { ptr, u64, u64 } __anon_01 local { { ptr, u64, u64 } } __anon_1 local { ptr, u64, u64 } __anon_10 - local { u64, u64 } __anon_11 + local { ptr, u64 } __anon_11 local { { ptr, u64, u64 } } __anon_2 local slice __ret_value local { { ptr, u64, u64 } } buffer @@ -79,133 +79,129 @@ script { v0 = get_local __ptr slice, __ret_value v1 = call main_8(), !51 v2 = const u64 1024 - v3 = asm(cap: v2) -> u64 hp, !56 { + v3 = asm(cap: v2) -> ptr hp, !56 { aloc cap } - v4 = int_to_ptr v3 to ptr, !57 - v5 = get_local __ptr { ptr, u64, u64 }, __anon_0, !58 - v6 = const u64 0 - v7 = get_elem_ptr v5, __ptr ptr, v6, !59 - store v4 to v7, !60 - v8 = const u64 1 - v9 = get_elem_ptr v5, __ptr u64, v8, !61 - store v2 to v9, !62 - v10 = const u64 2 - v11 = get_elem_ptr v5, __ptr u64, v10, !63 - v12 = const u64 0 - store v12 to v11, !64 - v13 = asm(buffer: v5) -> __ptr { ptr, u64, u64 } buffer { + v4 = get_local __ptr { ptr, u64, u64 }, __anon_0, !57 + v5 = const u64 0 + v6 = get_elem_ptr v4, __ptr ptr, v5, !58 + store v3 to v6, !59 + v7 = const u64 1 + v8 = get_elem_ptr v4, __ptr u64, v7, !60 + store v2 to v8, !61 + v9 = const u64 2 + v10 = get_elem_ptr v4, __ptr u64, v9, !62 + v11 = const u64 0 + store v11 to v10, !63 + v12 = asm(buffer: v4) -> __ptr { ptr, u64, u64 } buffer { } - v14 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 - mem_copy_val v14, v13 - v15 = get_local __ptr { { ptr, u64, u64 } }, __anon_1, !66 - v16 = const u64 0 - v17 = get_elem_ptr v15, __ptr { ptr, u64, u64 }, v16, !67 + v13 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 + mem_copy_val v13, v12 + v14 = get_local __ptr { { ptr, u64, u64 } }, __anon_1, !65 + v15 = const u64 0 + v16 = get_elem_ptr v14, __ptr { ptr, u64, u64 }, v15, !66 + mem_copy_val v16, v13 + v17 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !69 mem_copy_val v17, v14 - v18 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !70 - mem_copy_val v18, v15 - v19 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !72 - v20 = const u64 0 - v21 = get_elem_ptr v19, __ptr { ptr, u64, u64 }, v20, !74 - v22 = asm(buffer: v21) -> __ptr { ptr, u64, u64 } buffer { + v18 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !71 + v19 = const u64 0 + v20 = get_elem_ptr v18, __ptr { ptr, u64, u64 }, v19, !73 + v21 = asm(buffer: v20) -> __ptr { ptr, u64, u64 } buffer { } - v23 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 + v22 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 + mem_copy_val v22, v21 + v23 = get_local __ptr { ptr, u64, u64 }, __anon_00, !74 mem_copy_val v23, v22 - v24 = get_local __ptr { ptr, u64, u64 }, __anon_00, !75 - mem_copy_val v24, v23 - v25 = const u64 0 - v26 = get_elem_ptr v24, __ptr ptr, v25, !76 - v27 = load v26, !77 - v28 = const u64 1 - v29 = get_elem_ptr v24, __ptr u64, v28, !78 - v30 = load v29, !79 - v31 = const u64 2 - v32 = get_elem_ptr v24, __ptr u64, v31, !80 - v33 = load v32, !81 - v34 = const u64 8 - v35 = add v33, v34, !82 - v36 = cmp gt v35 v30, !83 - cbr v36, encode_10_abi_encode_11_block1(), encode_10_abi_encode_11_block0(v27, v30), !84 + v24 = const u64 0 + v25 = get_elem_ptr v23, __ptr ptr, v24, !75 + v26 = load v25, !76 + v27 = const u64 1 + v28 = get_elem_ptr v23, __ptr u64, v27, !77 + v29 = load v28, !78 + v30 = const u64 2 + v31 = get_elem_ptr v23, __ptr u64, v30, !79 + v32 = load v31, !80 + v33 = const u64 8 + v34 = add v32, v33, !81 + v35 = cmp gt v34 v29, !82 + cbr v35, encode_10_abi_encode_11_block1(), encode_10_abi_encode_11_block0(v26, v29), !83 - encode_10_abi_encode_11_block0(v37: ptr, v38: u64): - v39 = ptr_to_int v37 to u64, !85 - v40 = add v39, v33, !86 - v41 = int_to_ptr v40 to __ptr u64, !87 - store v1 to v41, !88 - v42 = get_local __ptr { ptr, u64, u64 }, __anon_10, !89 - v43 = const u64 0 - v44 = get_elem_ptr v42, __ptr ptr, v43, !90 + encode_10_abi_encode_11_block0(v36: ptr, v37: u64): + v38 = add v36, v32, !84 + v39 = cast_ptr v38 to __ptr u64, !85 + store v1 to v39, !86 + v40 = get_local __ptr { ptr, u64, u64 }, __anon_10, !87 + v41 = const u64 0 + v42 = get_elem_ptr v40, __ptr ptr, v41, !88 + store v36 to v42, !89 + v43 = const u64 1 + v44 = get_elem_ptr v40, __ptr u64, v43, !90 store v37 to v44, !91 - v45 = const u64 1 - v46 = get_elem_ptr v42, __ptr u64, v45, !92 - store v38 to v46, !93 - v47 = const u64 2 - v48 = get_elem_ptr v42, __ptr u64, v47, !94 - store v35 to v48, !95 - v49 = asm(buffer: v42) -> __ptr { ptr, u64, u64 } buffer { + v45 = const u64 2 + v46 = get_elem_ptr v40, __ptr u64, v45, !92 + store v34 to v46, !93 + v47 = asm(buffer: v40) -> __ptr { ptr, u64, u64 } buffer { } - v50 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_01 - mem_copy_val v50, v49 - v51 = get_local __ptr { { ptr, u64, u64 } }, __anon_2, !97 - v52 = const u64 0 - v53 = get_elem_ptr v51, __ptr { ptr, u64, u64 }, v52, !98 - mem_copy_val v53, v50 - v54 = get_local __ptr { { ptr, u64, u64 } }, buffer, !100 - mem_copy_val v54, v51 - v55 = get_local __ptr { { ptr, u64, u64 } }, buffer, !102 - v56 = get_local __ptr { { ptr, u64, u64 } }, self_0, !105 - mem_copy_val v56, v55 - v57 = get_local __ptr { { ptr, u64, u64 } }, self_0, !107 - v58 = const u64 0 - v59 = get_elem_ptr v57, __ptr { ptr, u64, u64 }, v58, !108 - v60 = asm(buffer: v59) -> __ptr { ptr, u64, u64 } buffer { + v48 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_01 + mem_copy_val v48, v47 + v49 = get_local __ptr { { ptr, u64, u64 } }, __anon_2, !95 + v50 = const u64 0 + v51 = get_elem_ptr v49, __ptr { ptr, u64, u64 }, v50, !96 + mem_copy_val v51, v48 + v52 = get_local __ptr { { ptr, u64, u64 } }, buffer, !98 + mem_copy_val v52, v49 + v53 = get_local __ptr { { ptr, u64, u64 } }, buffer, !100 + v54 = get_local __ptr { { ptr, u64, u64 } }, self_0, !103 + mem_copy_val v54, v53 + v55 = get_local __ptr { { ptr, u64, u64 } }, self_0, !105 + v56 = const u64 0 + v57 = get_elem_ptr v55, __ptr { ptr, u64, u64 }, v56, !106 + v58 = asm(buffer: v57) -> __ptr { ptr, u64, u64 } buffer { } - v61 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_02 - mem_copy_val v61, v60 - v62 = get_local __ptr { ptr, u64, u64 }, __anon_01, !109 - mem_copy_val v62, v61 - v63 = const u64 0 - v64 = get_elem_ptr v62, __ptr ptr, v63, !110 - v65 = load v64, !111 - v66 = const u64 2 - v67 = get_elem_ptr v62, __ptr u64, v66, !112 - v68 = ptr_to_int v65 to u64, !113 - v69 = get_local __ptr { u64, u64 }, __anon_11, !114 - v70 = const u64 0 - v71 = get_elem_ptr v69, __ptr u64, v70, !115 - store v68 to v71, !116 - v72 = const u64 1 - v73 = get_elem_ptr v69, __ptr u64, v72, !117 - mem_copy_val v73, v67 - v74 = asm(s: v69) -> __ptr slice s { + v59 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_02 + mem_copy_val v59, v58 + v60 = get_local __ptr { ptr, u64, u64 }, __anon_01, !107 + mem_copy_val v60, v59 + v61 = const u64 0 + v62 = get_elem_ptr v60, __ptr ptr, v61, !108 + v63 = const u64 2 + v64 = get_elem_ptr v60, __ptr u64, v63, !109 + v65 = get_local __ptr { ptr, u64 }, __anon_11, !110 + v66 = const u64 0 + v67 = get_elem_ptr v65, __ptr ptr, v66, !111 + mem_copy_val v67, v62 + v68 = const u64 1 + v69 = get_elem_ptr v65, __ptr u64, v68, !112 + mem_copy_val v69, v64 + v70 = asm(s: v65) -> __ptr slice s { } - v75 = get_local __ptr slice, __aggr_memcpy_03 - mem_copy_val v75, v74 - mem_copy_val v0, v75 + v71 = get_local __ptr slice, __aggr_memcpy_03 + mem_copy_val v71, v70 + mem_copy_val v0, v71 ret __ptr slice v0 encode_10_abi_encode_11_block1(): - v76 = const u64 2 - v77 = mul v30, v76, !118 - v78 = add v77, v34, !119 - v79 = asm(new_cap: v78, old_ptr: v27, len: v33) -> __ptr u8 hp, !120 { + v72 = const u64 2 + v73 = mul v29, v72, !113 + v74 = add v73, v33, !114 + v75 = asm(new_cap: v74, old_ptr: v26, len: v32) -> __ptr u8 hp, !115 { aloc new_cap mcp hp old_ptr len } - br encode_10_abi_encode_11_block0(v79, v78), !121 + br encode_10_abi_encode_11_block0(v75, v74), !116 } - entry_orig fn main_8() -> u64, !124 { + entry_orig fn main_8() -> u64, !119 { entry(): - v0 = get_config __ptr { u64 }, WRAPPED, !125 + v0 = get_config __ptr { u64 }, WRAPPED, !120 v1 = const u64 0 - v2 = get_elem_ptr v0, __ptr u64, v1, !126 + v2 = get_elem_ptr v0, __ptr u64, v1, !121 v3 = load v2 - v4 = get_config __ptr { u64 }, TUPLE, !127 + v4 = get_config __ptr { u64 }, TUPLE, !122 v5 = const u64 0 - v6 = get_elem_ptr v4, __ptr u64, v5, !128 + v6 = get_elem_ptr v4, __ptr u64, v5, !123 v7 = load v6 - v8 = add v3, v7, !131 + v8 = add v3, v7, !126 ret u64 v8 } } @@ -274,74 +270,69 @@ script { !61 = (!52 !53 !54 !55) !62 = (!52 !53 !54 !55) !63 = (!52 !53 !54 !55) -!64 = (!52 !53 !54 !55) -!65 = span !3 191 254 -!66 = (!52 !53 !54 !55 !65) -!67 = (!52 !53 !54 !55) -!68 = span !3 67754 67784 -!69 = fn_call_path_span !3 67759 67769 -!70 = (!52 !53 !68 !69) -!71 = span !3 4768 4774 -!72 = (!52 !53 !68 !69 !71) -!73 = span !3 87 114 -!74 = (!52 !53 !68 !69 !73) -!75 = (!52 !53 !68 !69) -!76 = (!52 !53 !68 !69) -!77 = (!52 !53 !68 !69) -!78 = (!52 !53 !68 !69) -!79 = (!52 !53 !68 !69) -!80 = (!52 !53 !68 !69) -!81 = (!52 !53 !68 !69) -!82 = (!52 !53 !68 !69) -!83 = (!52 !53 !68 !69) -!84 = (!52 !53 !68 !69) -!85 = (!52 !53 !68 !69) -!86 = (!52 !53 !68 !69) -!87 = (!52 !53 !68 !69) -!88 = (!52 !53 !68 !69) -!89 = (!52 !53 !68 !69) -!90 = (!52 !53 !68 !69) -!91 = (!52 !53 !68 !69) -!92 = (!52 !53 !68 !69) -!93 = (!52 !53 !68 !69) -!94 = (!52 !53 !68 !69) -!95 = (!52 !53 !68 !69) -!96 = span !3 4716 4799 -!97 = (!52 !53 !68 !69 !96) -!98 = (!52 !53 !68 !69) -!99 = span !3 67741 67785 +!64 = span !3 191 254 +!65 = (!52 !53 !54 !55 !64) +!66 = (!52 !53 !54 !55) +!67 = span !3 67754 67784 +!68 = fn_call_path_span !3 67759 67769 +!69 = (!52 !53 !67 !68) +!70 = span !3 4768 4774 +!71 = (!52 !53 !67 !68 !70) +!72 = span !3 87 114 +!73 = (!52 !53 !67 !68 !72) +!74 = (!52 !53 !67 !68) +!75 = (!52 !53 !67 !68) +!76 = (!52 !53 !67 !68) +!77 = (!52 !53 !67 !68) +!78 = (!52 !53 !67 !68) +!79 = (!52 !53 !67 !68) +!80 = (!52 !53 !67 !68) +!81 = (!52 !53 !67 !68) +!82 = (!52 !53 !67 !68) +!83 = (!52 !53 !67 !68) +!84 = (!52 !53 !67 !68) +!85 = (!52 !53 !67 !68) +!86 = (!52 !53 !67 !68) +!87 = (!52 !53 !67 !68) +!88 = (!52 !53 !67 !68) +!89 = (!52 !53 !67 !68) +!90 = (!52 !53 !67 !68) +!91 = (!52 !53 !67 !68) +!92 = (!52 !53 !67 !68) +!93 = (!52 !53 !67 !68) +!94 = span !3 4716 4799 +!95 = (!52 !53 !67 !68 !94) +!96 = (!52 !53 !67 !68) +!97 = span !3 67741 67785 +!98 = (!52 !53 !97) +!99 = span !3 67790 67796 !100 = (!52 !53 !99) -!101 = span !3 67790 67796 -!102 = (!52 !53 !101) -!103 = span !3 67790 67811 -!104 = fn_call_path_span !3 67797 67809 -!105 = (!52 !53 !103 !104) -!106 = span !3 573 577 -!107 = (!52 !53 !103 !104 !106) -!108 = (!52 !53 !103 !104 !73) -!109 = (!52 !53 !103 !104) -!110 = (!52 !53 !103 !104) -!111 = (!52 !53 !103 !104) -!112 = (!52 !53 !103 !104) -!113 = (!52 !53 !103 !104) -!114 = (!52 !53 !103 !104) -!115 = (!52 !53 !103 !104) -!116 = (!52 !53 !103 !104) -!117 = (!52 !53 !103 !104) -!118 = (!52 !53 !68 !69) -!119 = (!52 !53 !68 !69) -!120 = (!52 !53 !68 !69) -!121 = (!52 !53 !68 !69) -!122 = span !0 202 246 -!123 = fn_name_span !0 205 209 -!124 = (!122 !123) -!125 = span !0 225 232 -!126 = span !0 30 36 -!127 = span !0 237 242 -!128 = span !0 243 244 -!129 = span !0 225 244 -!130 = fn_call_path_span !0 235 236 -!131 = (!129 !130) +!101 = span !3 67790 67811 +!102 = fn_call_path_span !3 67797 67809 +!103 = (!52 !53 !101 !102) +!104 = span !3 573 577 +!105 = (!52 !53 !101 !102 !104) +!106 = (!52 !53 !101 !102 !72) +!107 = (!52 !53 !101 !102) +!108 = (!52 !53 !101 !102) +!109 = (!52 !53 !101 !102) +!110 = (!52 !53 !101 !102) +!111 = (!52 !53 !101 !102) +!112 = (!52 !53 !101 !102) +!113 = (!52 !53 !67 !68) +!114 = (!52 !53 !67 !68) +!115 = (!52 !53 !67 !68) +!116 = (!52 !53 !67 !68) +!117 = span !0 202 246 +!118 = fn_name_span !0 205 209 +!119 = (!117 !118) +!120 = span !0 225 232 +!121 = span !0 30 36 +!122 = span !0 237 242 +!123 = span !0 243 244 +!124 = span !0 225 244 +!125 = fn_call_path_span !0 235 236 +!126 = (!124 !125) ;; ASM: Final program ;; Program kind: Script @@ -358,15 +349,15 @@ cfei i16 ; allocate stack space for globals addr $$arg0 data_Configurable_0; get pointer to configurable TUPLE default value addi $$arg1 $zero i8 ; get length of configurable TUPLE default value addi $$arg2 $ssp i0 ; get pointer to configurable TUPLE stack address -jal $$reta $pc i75 ; decode configurable TUPLE +jal $$reta $pc i74 ; decode configurable TUPLE addr $$arg0 data_Configurable_1; get pointer to configurable WRAPPED default value addi $$arg1 $zero i8 ; get length of configurable WRAPPED default value addi $$arg2 $ssp i8 ; get pointer to configurable WRAPPED stack address -jal $$reta $pc i70 ; decode configurable WRAPPED +jal $$reta $pc i69 ; decode configurable WRAPPED move $$locbase $sp ; save locals base register for function __entry cfei i360 ; allocate 360 bytes for locals and 0 slots for call arguments addi $r0 $$locbase i272 ; get offset to local -jal $$reta $pc i94 ; [call]: call main_8 +jal $$reta $pc i93 ; [call]: call main_8 move $r1 $$retv ; [call]: copy the return value movi $r2 i1024 ; initialize constant into register aloc $r2 @@ -420,12 +411,11 @@ addi $r2 $$locbase i72 ; get offset to local mcpi $r2 $r1 i24 ; copy memory addi $r1 $$locbase i160 ; get offset to local mcpi $r1 $r2 i24 ; copy memory -lw $r2 $$locbase i20 ; load word -addi $r1 $r1 i16 ; get offset to aggregate element +addi $r2 $r1 i16 ; get offset to aggregate element addi $r3 $$locbase i232 ; get offset to local -sw $$locbase $r2 i29 ; store word -addi $r2 $r3 i8 ; get offset to aggregate element -mcpi $r2 $r1 i8 ; copy memory +mcpi $r3 $r1 i8 ; copy memory +addi $r1 $r3 i8 ; get offset to aggregate element +mcpi $r1 $r2 i8 ; copy memory addi $r1 $$locbase i96 ; get offset to local mcpi $r1 $r3 i16 ; copy memory mcpi $r0 $r1 i16 ; copy memory diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_handling_in_unit_tests/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_handling_in_unit_tests/stdout.snap index 81ecd1a51a..bc70b6f0b1 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_handling_in_unit_tests/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_handling_in_unit_tests/stdout.snap @@ -24,7 +24,7 @@ ____ tested -- panic_handling_in_unit_tests - test passing_dbgs_and_logs ... ok (???, 2219 gas) + test passing_dbgs_and_logs ... ok (???, 2221 gas) debug output: [src/main.sw:23:13] "This is a passing test containing `__dbg` outputs." = "This is a passing test containing `__dbg` outputs." [src/main.sw:25:13] x = 42 @@ -32,7 +32,7 @@ tested -- panic_handling_in_unit_tests AsciiString { data: "This is a log from the passing test." }, log rb: 10098701174489624218 42, log rb: 1515152261580153489 raw logs: -[{"LogData":{"data":"0000000000000024546869732069732061206c6f672066726f6d207468652070617373696e6720746573742e","digest":"29d742ad9093cdf81404ff756467a44448729b85ab3c0d65197829fb61d2dd29","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":44,"pc":16216,"ptr":67107840,"ra":0,"rb":10098701174489624218}},{"LogData":{"data":"000000000000002a","digest":"a6bb133cb1e3638ad7b8a3ff0539668e9e56f9b850ef1b2a810f5422eaa6c323","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":16652,"ptr":67106816,"ra":0,"rb":1515152261580153489}}] +[{"LogData":{"data":"0000000000000024546869732069732061206c6f672066726f6d207468652070617373696e6720746573742e","digest":"29d742ad9093cdf81404ff756467a44448729b85ab3c0d65197829fb61d2dd29","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":44,"pc":16212,"ptr":67107840,"ra":0,"rb":10098701174489624218}},{"LogData":{"data":"000000000000002a","digest":"a6bb133cb1e3638ad7b8a3ff0539668e9e56f9b850ef1b2a810f5422eaa6c323","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":16648,"ptr":67106816,"ra":0,"rb":1515152261580153489}}] test passing_no_dbgs_or_logs ... ok (???, 18 gas) test result: OK. 2 passed; 0 failed; finished in ??? @@ -61,26 +61,26 @@ ____ tested -- panic_handling_in_unit_tests - test passing_dbgs_and_logs ... ok (???, 2219 gas) + test passing_dbgs_and_logs ... ok (???, 2221 gas) test passing_no_dbgs_or_logs ... ok (???, 18 gas) test failing_revert_intrinsic ... FAILED (???, 19 gas) - test failing_revert_function_with_dbgs_and_logs ... FAILED (???, 2347 gas) + test failing_revert_function_with_dbgs_and_logs ... FAILED (???, 2348 gas) test failing_error_signal_assert ... FAILED (???, 497 gas) - test failing_error_signal_assert_eq ... FAILED (???, 1393 gas) - test failing_error_signal_assert_ne ... FAILED (???, 1388 gas) - test failing_error_signal_require_str_error ... FAILED (???, 319 gas) - test failing_error_signal_require_enum_error ... FAILED (???, 413 gas) - test failing_panic_no_arg ... FAILED (???, 194 gas) - test failing_panic_unit_arg ... FAILED (???, 194 gas) + test failing_error_signal_assert_eq ... FAILED (???, 1396 gas) + test failing_error_signal_assert_ne ... FAILED (???, 1391 gas) + test failing_error_signal_require_str_error ... FAILED (???, 320 gas) + test failing_error_signal_require_enum_error ... FAILED (???, 414 gas) + test failing_panic_no_arg ... FAILED (???, 195 gas) + test failing_panic_unit_arg ... FAILED (???, 195 gas) test failing_panic_const_eval_str_arg ... FAILED (???, 19 gas) test failing_panic_const_eval_empty_str_arg ... FAILED (???, 19 gas) test failing_panic_const_eval_whitespace_str_arg ... FAILED (???, 19 gas) - test failing_panic_non_const_eval_str_arg ... FAILED (???, 297 gas) - test failing_panic_non_const_eval_str_empty_arg ... FAILED (???, 291 gas) - test failing_panic_non_const_eval_str_whitespace_arg ... FAILED (???, 297 gas) - test failing_panic_error_enum_arg ... FAILED (???, 394 gas) - test failing_panic_error_enum_arg_with_empty_msg ... FAILED (???, 486 gas) - test failing_panic_error_enum_arg_with_whitespace_msg ... FAILED (???, 503 gas) + test failing_panic_non_const_eval_str_arg ... FAILED (???, 298 gas) + test failing_panic_non_const_eval_str_empty_arg ... FAILED (???, 292 gas) + test failing_panic_non_const_eval_str_whitespace_arg ... FAILED (???, 298 gas) + test failing_panic_error_enum_arg ... FAILED (???, 395 gas) + test failing_panic_error_enum_arg_with_empty_msg ... FAILED (???, 487 gas) + test failing_panic_error_enum_arg_with_whitespace_msg ... FAILED (???, 504 gas) failures: test failing_revert_intrinsic, "test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_handling_in_unit_tests/src/main.sw":34 @@ -103,7 +103,7 @@ AsciiString { data: "This is a log from the reverting test." }, log rb: 10098701 "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 46, - "pc": 16216, + "pc": 16212, "ptr": 67107840, "ra": 0, "rb": 10098701174489624218 @@ -137,7 +137,7 @@ AsciiString { data: "We will get logged the asserted values and this message." } "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 64, - "pc": 16216, + "pc": 16212, "ptr": 67107840, "ra": 0, "rb": 10098701174489624218 @@ -150,7 +150,7 @@ AsciiString { data: "We will get logged the asserted values and this message." } "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 8, - "pc": 16652, + "pc": 16648, "ptr": 67106816, "ra": 0, "rb": 1515152261580153489 @@ -163,7 +163,7 @@ AsciiString { data: "We will get logged the asserted values and this message." } "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 8, - "pc": 16652, + "pc": 16648, "ptr": 67105792, "ra": 0, "rb": 1515152261580153489 @@ -190,7 +190,7 @@ AsciiString { data: "We will get logged the asserted values and this message." } "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 64, - "pc": 16216, + "pc": 16212, "ptr": 67107840, "ra": 0, "rb": 10098701174489624218 @@ -203,7 +203,7 @@ AsciiString { data: "We will get logged the asserted values and this message." } "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 8, - "pc": 16652, + "pc": 16648, "ptr": 67106816, "ra": 0, "rb": 1515152261580153489 @@ -216,7 +216,7 @@ AsciiString { data: "We will get logged the asserted values and this message." } "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 8, - "pc": 16652, + "pc": 16648, "ptr": 67105792, "ra": 0, "rb": 1515152261580153489 @@ -239,7 +239,7 @@ AsciiString { data: "This is an error message in a `require` call." }, log rb: 1 "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 53, - "pc": 16216, + "pc": 16212, "ptr": 67107840, "ra": 0, "rb": 10098701174489624218 @@ -352,7 +352,7 @@ AsciiString { data: "Panicked with a non-const evaluated string argument." }, lo "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 60, - "pc": 18500, + "pc": 18496, "ptr": 67107840, "ra": 0, "rb": 10098701174489624218 @@ -376,7 +376,7 @@ AsciiString { data: "" }, log rb: 10098701174489624218 "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 8, - "pc": 18500, + "pc": 18496, "ptr": 67107840, "ra": 0, "rb": 10098701174489624218 @@ -400,7 +400,7 @@ AsciiString { data: " " }, log rb: 10098701174489624218 "id": "0000000000000000000000000000000000000000000000000000000000000000", "is": 10368, "len": 12, - "pc": 18500, + "pc": 18496, "ptr": 67107840, "ra": 0, "rb": 10098701174489624218 diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_contract/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_contract/stdout.snap index 7d0096554d..3c528de1e4 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_contract/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_contract/stdout.snap @@ -9,78 +9,78 @@ output: Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling library panicking_lib (test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib) Compiling contract panicking_contract (test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_contract) - Finished release [optimized + fuel] target(s) [8.168 KB] in ??? + Finished release [optimized + fuel] target(s) [8.136 KB] in ??? Running 11 tests, filtered 0 tests tested -- panicking_contract - test test_directly_panicking_method ... ok (???, 1635 gas) + test test_directly_panicking_method ... ok (???, 1595 gas) revert code: ffffffff00000000 ├─ panic message: Error C. ├─ panic value: C(true) └─ panicked in: panicking_contract@1.2.3, src/main.sw:22:9 decoded log values: C(true), log rb: 5503570629422409978 - test test_nested_panic_inlined ... ok (???, 2961 gas) + test test_nested_panic_inlined ... ok (???, 2921 gas) revert code: ffffffff00000005 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) └─ panicked in: panicking_lib, src/lib.sw:41:9 decoded log values: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978 - test test_nested_panic_inlined_same_revert_code ... ok (???, 2961 gas) + test test_nested_panic_inlined_same_revert_code ... ok (???, 2921 gas) revert code: ffffffff00000005 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) └─ panicked in: panicking_lib, src/lib.sw:41:9 decoded log values: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978 - test test_nested_panic_not_inlined ... ok (???, 3160 gas) + test test_nested_panic_not_inlined ... ok (???, 3120 gas) revert code: ffffffff00000006 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) └─ panicked in: panicking_lib, src/lib.sw:35:5 decoded log values: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978 - test test_nested_panic_not_inlined_same_revert_code ... ok (???, 3160 gas) + test test_nested_panic_not_inlined_same_revert_code ... ok (???, 3120 gas) revert code: ffffffff00000006 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) └─ panicked in: panicking_lib, src/lib.sw:35:5 decoded log values: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978 - test test_generic_panic_with_unit ... ok (???, 2092 gas) + test test_generic_panic_with_unit ... ok (???, 2052 gas) revert code: ffffffff00000004 ├─ panic value: () └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_unit_same_revert_code ... ok (???, 2092 gas) + test test_generic_panic_with_unit_same_revert_code ... ok (???, 2052 gas) revert code: ffffffff00000004 ├─ panic value: () └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_str ... ok (???, 2102 gas) + test test_generic_panic_with_str ... ok (???, 2062 gas) revert code: ffffffff00000002 ├─ panic message: generic panic with string └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 - test test_generic_panic_with_different_str_same_revert_code ... ok (???, 1772 gas) + test test_generic_panic_with_different_str_same_revert_code ... ok (???, 1732 gas) revert code: ffffffff00000002 ├─ panic message: generic panic with different string └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: AsciiString { data: "generic panic with different string" }, log rb: 10098701174489624218 - test test_generic_panic_with_error_type_enum ... ok (???, 1902 gas) + test test_generic_panic_with_error_type_enum ... ok (???, 1862 gas) revert code: ffffffff00000003 ├─ panic message: Error A. ├─ panic value: A └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: A, log rb: 5503570629422409978 - test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 2071 gas) + test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 2031 gas) revert code: ffffffff00000003 ├─ panic message: Error B. ├─ panic value: B(42) diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib/stdout.snap index bef74edd6c..8298b2b414 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib/stdout.snap @@ -8,84 +8,84 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling library panicking_lib (test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib) - Finished release [optimized + fuel] target(s) [5.688 KB] in ??? + Finished release [optimized + fuel] target(s) [5.656 KB] in ??? Running 18 tests, filtered 0 tests tested -- panicking_lib - test test_nested_panic_inlined ... ok (???, 808 gas) + test test_nested_panic_inlined ... ok (???, 798 gas) revert code: ffffffff00000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) └─ panicked in: panicking_lib, src/lib.sw:41:9 decoded log values: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 2721958641300806892 - test test_nested_panic_inlined_same_revert_code ... ok (???, 808 gas) + test test_nested_panic_inlined_same_revert_code ... ok (???, 798 gas) revert code: ffffffff00000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) └─ panicked in: panicking_lib, src/lib.sw:41:9 decoded log values: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 2721958641300806892 - test test_nested_panic_not_inlined ... ok (???, 787 gas) + test test_nested_panic_not_inlined ... ok (???, 777 gas) revert code: ffffffff00000001 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) └─ panicked in: panicking_lib, src/lib.sw:35:5 decoded log values: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 2721958641300806892 - test test_nested_panic_not_inlined_same_revert_code ... ok (???, 787 gas) + test test_nested_panic_not_inlined_same_revert_code ... ok (???, 777 gas) revert code: ffffffff00000001 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) └─ panicked in: panicking_lib, src/lib.sw:35:5 decoded log values: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 2721958641300806892 - test test_generic_panic_with_unit ... ok (???, 152 gas) + test test_generic_panic_with_unit ... ok (???, 142 gas) revert code: ffffffff00000002 ├─ panic value: () └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_unit_same_revert_code ... ok (???, 152 gas) + test test_generic_panic_with_unit_same_revert_code ... ok (???, 142 gas) revert code: ffffffff00000002 ├─ panic value: () └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_str ... ok (???, 283 gas) + test test_generic_panic_with_str ... ok (???, 273 gas) revert code: ffffffff00000003 ├─ panic message: generic panic with string └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 - test test_generic_panic_with_different_str_same_revert_code ... ok (???, 283 gas) + test test_generic_panic_with_different_str_same_revert_code ... ok (???, 273 gas) revert code: ffffffff00000003 ├─ panic message: generic panic different string └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: AsciiString { data: "generic panic different string" }, log rb: 10098701174489624218 - test test_generic_panic_with_error_type_enum_variant ... ok (???, 303 gas) + test test_generic_panic_with_error_type_enum_variant ... ok (???, 293 gas) revert code: ffffffff00000004 ├─ panic message: Error A. ├─ panic value: A └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: A, log rb: 2721958641300806892 - test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 303 gas) + test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 293 gas) revert code: ffffffff00000004 ├─ panic message: Error A. ├─ panic value: A └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: A, log rb: 2721958641300806892 - test test_panic_without_arg ... ok (???, 152 gas) + test test_panic_without_arg ... ok (???, 142 gas) revert code: ffffffff00000005 ├─ panic value: () └─ panicked in: panicking_lib, src/lib.sw:113:5 decoded log values: (), log rb: 3330666440490685604 - test test_panic_with_unit ... ok (???, 152 gas) + test test_panic_with_unit ... ok (???, 142 gas) revert code: ffffffff00000006 ├─ panic value: () └─ panicked in: panicking_lib, src/lib.sw:118:5 @@ -95,32 +95,32 @@ A, log rb: 2721958641300806892 revert code: ffffffff00000007 ├─ panic message: panic with string └─ panicked in: panicking_lib, src/lib.sw:123:5 - test test_panic_with_error_type_enum ... ok (???, 395 gas) + test test_panic_with_error_type_enum ... ok (???, 385 gas) revert code: ffffffff00000008 ├─ panic message: Error C. ├─ panic value: C(true) └─ panicked in: panicking_lib, src/lib.sw:128:5 decoded log values: C(true), log rb: 2721958641300806892 - test test_panic_with_generic_error_type_enum ... ok (???, 335 gas) + test test_panic_with_generic_error_type_enum ... ok (???, 325 gas) revert code: ffffffff00000009 ├─ panic value: A(42) └─ panicked in: panicking_lib, src/lib.sw:133:5 decoded log values: A(42), log rb: 12408470889216862137 - test test_panic_with_nested_generic_error_type ... ok (???, 614 gas) + test test_panic_with_nested_generic_error_type ... ok (???, 604 gas) revert code: ffffffff0000000a ├─ panic value: B(B(C(true))) └─ panicked in: panicking_lib, src/lib.sw:138:5 decoded log values: B(B(C(true))), log rb: 14988555917426256081 - test test_panic_with_generic_error_type_enum_with_abi_encode ... ok (???, 335 gas) + test test_panic_with_generic_error_type_enum_with_abi_encode ... ok (???, 325 gas) revert code: ffffffff0000000b ├─ panic value: A(42) └─ panicked in: panicking_lib, src/lib.sw:143:5 decoded log values: A(42), log rb: 17388243649088655852 - test test_panic_with_nested_generic_error_type_enum_with_abi_encode ... ok (???, 614 gas) + test test_panic_with_nested_generic_error_type_enum_with_abi_encode ... ok (???, 604 gas) revert code: ffffffff0000000c ├─ panic value: B(B(C(true))) └─ panicked in: panicking_lib, src/lib.sw:148:5 diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_script/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_script/stdout.snap index 61b4177da0..6da9aa5bdf 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_script/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_script/stdout.snap @@ -9,78 +9,78 @@ output: Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling library panicking_lib (test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib) Compiling script panicking_script (test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_script) - Finished release [optimized + fuel] target(s) [3.72 KB] in ??? + Finished release [optimized + fuel] target(s) [3.688 KB] in ??? Running 11 tests, filtered 0 tests tested -- panicking_script - test test_panic_in_main ... ok (???, 372 gas) + test test_panic_in_main ... ok (???, 362 gas) revert code: ffffffff00000000 ├─ panic message: Error C. ├─ panic value: C(true) └─ panicked in: panicking_script, src/main.sw:6:5 decoded log values: C(true), log rb: 5503570629422409978 - test test_nested_panic_inlined ... ok (???, 810 gas) + test test_nested_panic_inlined ... ok (???, 800 gas) revert code: ffffffff00000001 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) └─ panicked in: panicking_lib, src/lib.sw:41:9 decoded log values: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978 - test test_nested_panic_inlined_same_revert_code ... ok (???, 810 gas) + test test_nested_panic_inlined_same_revert_code ... ok (???, 800 gas) revert code: ffffffff00000001 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) └─ panicked in: panicking_lib, src/lib.sw:41:9 decoded log values: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978 - test test_nested_panic_not_inlined ... ok (???, 790 gas) + test test_nested_panic_not_inlined ... ok (???, 780 gas) revert code: ffffffff00000002 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) └─ panicked in: panicking_lib, src/lib.sw:35:5 decoded log values: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978 - test test_nested_panic_not_inlined_same_revert_code ... ok (???, 790 gas) + test test_nested_panic_not_inlined_same_revert_code ... ok (???, 780 gas) revert code: ffffffff00000002 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) └─ panicked in: panicking_lib, src/lib.sw:35:5 decoded log values: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978 - test test_generic_panic_with_unit ... ok (???, 152 gas) + test test_generic_panic_with_unit ... ok (???, 142 gas) revert code: ffffffff00000003 ├─ panic value: () └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_unit_same_revert_code ... ok (???, 152 gas) + test test_generic_panic_with_unit_same_revert_code ... ok (???, 142 gas) revert code: ffffffff00000003 ├─ panic value: () └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_str ... ok (???, 283 gas) + test test_generic_panic_with_str ... ok (???, 273 gas) revert code: ffffffff00000004 ├─ panic message: generic panic with string └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 - test test_generic_panic_with_different_str_same_revert_code ... ok (???, 283 gas) + test test_generic_panic_with_different_str_same_revert_code ... ok (???, 273 gas) revert code: ffffffff00000004 ├─ panic message: generic panic with different string └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: AsciiString { data: "generic panic with different string" }, log rb: 10098701174489624218 - test test_generic_panic_with_error_type_enum ... ok (???, 298 gas) + test test_generic_panic_with_error_type_enum ... ok (???, 288 gas) revert code: ffffffff00000005 ├─ panic message: Error A. ├─ panic value: A └─ panicked in: panicking_lib, src/lib.sw:74:5 decoded log values: A, log rb: 5503570629422409978 - test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 357 gas) + test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 347 gas) revert code: ffffffff00000005 ├─ panic message: Error B. ├─ panic value: B(42) diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/u256/u256_abi/json_abi_oracle_new_encoding.json b/test/src/e2e_vm_tests/test_programs/should_pass/language/u256/u256_abi/json_abi_oracle_new_encoding.json index 3d8f8e3d1d..17a8f6e617 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/u256/u256_abi/json_abi_oracle_new_encoding.json +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/u256/u256_abi/json_abi_oracle_new_encoding.json @@ -10,7 +10,7 @@ "concreteTypeId": "1b5759d94094368cfd443019e7ca5ec4074300e544e5ea993a979f5da627261e", "indirect": false, "name": "SOME_U256", - "offset": 752 + "offset": 744 } ], "encodingVersion": "1", diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/panic_in_non_statement_positions/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/panic_in_non_statement_positions/stdout.snap index 361ddb4a4c..3e1b8d4128 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/panic_in_non_statement_positions/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/panic_in_non_statement_positions/stdout.snap @@ -1,5 +1,6 @@ --- source: test/src/snapshot/mod.rs +assertion_line: 162 --- > forc test --path test/src/e2e_vm_tests/test_programs/should_pass/panic_in_non_statement_positions --logs --test-threads 1 exit status: 0 @@ -286,57 +287,57 @@ warning ____ Compiled library "panic_in_non_statement_positions" with 23 warnings. - Finished debug [unoptimized + fuel] target(s) [2.128 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [2.12 KB] in ??? Running 16 tests, filtered 0 tests tested -- panic_in_non_statement_positions - test in_init ... ok (???, 351 gas) + test in_init ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_array ... ok (???, 351 gas) + test in_array ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_length_1_array ... ok (???, 351 gas) + test in_length_1_array ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_length_2_array_first ... ok (???, 351 gas) + test in_length_2_array_first ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_length_2_array_second ... ok (???, 351 gas) + test in_length_2_array_second ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_tuple ... ok (???, 351 gas) + test in_tuple ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_struct ... ok (???, 351 gas) + test in_struct ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_parentheses ... ok (???, 351 gas) + test in_parentheses ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_if_condition ... ok (???, 351 gas) + test in_if_condition ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_while_condition ... ok (???, 351 gas) + test in_while_condition ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_enum ... ok (???, 351 gas) + test in_enum ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_enum_multivariant ... ok (???, 351 gas) + test in_enum_multivariant ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_fun_arg ... ok (???, 351 gas) + test in_fun_arg ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_lazy_and ... ok (???, 351 gas) + test in_lazy_and ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_lazy_or ... ok (???, 351 gas) + test in_lazy_or ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 - test in_match_scrutinee ... ok (???, 351 gas) + test in_match_scrutinee ... ok (???, 352 gas) decoded log values: E(42), log rb: 5087777005172090899 diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/array_of_structs_caller/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/array_of_structs_caller/src/main.sw index 8c6fe13fa1..2327fa3fe6 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/array_of_structs_caller/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/array_of_structs_caller/src/main.sw @@ -6,7 +6,7 @@ use std::hash::*; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0x14ed3cd06c2947248f69d54bfa681fe40d26267be84df7e19e253622b7921bbe; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0x2d207680bb16a764aafdd3dcb1240f9e7a59a7dca7f366fbfef90bf964be500f; // AUTO-CONTRACT-ID ../../test_contracts/array_of_structs_contract --release +const CONTRACT_ID = 0xbc79c91a95481c5414e861a294f86caa9ae996d3a736423cc9a6a928934abeef; // AUTO-CONTRACT-ID ../../test_contracts/array_of_structs_contract --release fn get_address() -> Option { Some(CONTRACT_ID.into()) diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/asset_ops_test/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/asset_ops_test/src/main.sw index c4f718151b..25c0afca8e 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/asset_ops_test/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/asset_ops_test/src/main.sw @@ -14,7 +14,7 @@ const FUEL_COIN_CONTRACT_ID = 0x68776e49d2128ae42ec01225bbf6c539ed4772494786dd81 #[cfg(experimental_new_encoding = false)] const BALANCE_CONTRACT_ID = 0xf6cd545152ac83225e8e7df2efb5c6fa6e37bc9b9e977b5ea8103d28668925df; #[cfg(experimental_new_encoding = true)] -const BALANCE_CONTRACT_ID = 0x7dbdd68390dcbfa60a2b3a45ad9b982b7e9f55d2aeda575df1f245e2d917de48; // AUTO-CONTRACT-ID ../../test_contracts/balance_test_contract --release +const BALANCE_CONTRACT_ID = 0xcb4895e795d860b37e866a09a8f08911e37f78c39dd4de8f5de1a1af8901f1f3; // AUTO-CONTRACT-ID ../../test_contracts/balance_test_contract --release fn main() -> bool { let default_gas = 1_000_000_000_000; diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/bal_opcode/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/bal_opcode/src/main.sw index 1ecc6fe3f0..fa37767085 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/bal_opcode/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/bal_opcode/src/main.sw @@ -5,7 +5,7 @@ use balance_test_abi::BalanceTest; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0xf6cd545152ac83225e8e7df2efb5c6fa6e37bc9b9e977b5ea8103d28668925df; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0x7dbdd68390dcbfa60a2b3a45ad9b982b7e9f55d2aeda575df1f245e2d917de48; // AUTO-CONTRACT-ID ../../test_contracts/balance_test_contract --release +const CONTRACT_ID = 0xcb4895e795d860b37e866a09a8f08911e37f78c39dd4de8f5de1a1af8901f1f3; // AUTO-CONTRACT-ID ../../test_contracts/balance_test_contract --release fn main() -> bool { let balance_test_contract = abi(BalanceTest, CONTRACT_ID); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_abi_with_tuples/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_abi_with_tuples/src/main.sw index 175b848d16..1b49ec4dc3 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_abi_with_tuples/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_abi_with_tuples/src/main.sw @@ -6,7 +6,7 @@ use abi_with_tuples::{MyContract, Location, Person}; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0xfdc14550c8aee742cd556d0ab7f378b7be0d3b1e6e086c097352e94590d4ed02; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0x3eeff7fa1fcc1f284bb1df049da7ac53fe5879bc9b7f0e307bb5cd7a51f03cfe; // AUTO-CONTRACT-ID ../../test_contracts/abi_with_tuples_contract --release +const CONTRACT_ID = 0xc899513a4e9f850e298959b7facc38b0ad6e2c3b5e1eecfb9768e0eb75ed5203; // AUTO-CONTRACT-ID ../../test_contracts/abi_with_tuples_contract --release fn main() -> bool { let the_abi = abi(MyContract, CONTRACT_ID); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_basic_storage/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_basic_storage/src/main.sw index bd28089423..d59d98cece 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_basic_storage/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_basic_storage/src/main.sw @@ -4,7 +4,7 @@ use basic_storage_abi::{BasicStorage, Quad}; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0x94db39f409a31b9f2ebcadeea44378e419208c20de90f5d8e1e33dc1523754cb; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0xa2042eefffce34f889cbebdbaa55357bbdf83b15870591155e196d210d8bfa65; // AUTO-CONTRACT-ID ../../test_contracts/basic_storage --release +const CONTRACT_ID = 0xbd57a0138d242c9386c3689c1280d5cbccdf3c6a7db820c5934e2e87682be1a4; // AUTO-CONTRACT-ID ../../test_contracts/basic_storage --release fn main() -> u64 { let addr = abi(BasicStorage, CONTRACT_ID); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_contract_with_type_aliases/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_contract_with_type_aliases/src/main.sw index 6d8c422f78..619eede3c9 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_contract_with_type_aliases/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_contract_with_type_aliases/src/main.sw @@ -5,7 +5,7 @@ use contract_with_type_aliases_abi::*; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0x0cbeb6efe3104b460be769bdc4ea101ebf16ccc16f2d7b667ec3e1c7f5ce35b5; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0x5c112a81e15b21b17295dd215c775270c6db148636043768d1f6e7799a2df9ea; // AUTO-CONTRACT-ID ../../test_contracts/contract_with_type_aliases --release +const CONTRACT_ID = 0x1893b1728265e4a683cb1882a69e417a2e69e3477e5547f7292fae36812cd8ff; // AUTO-CONTRACT-ID ../../test_contracts/contract_with_type_aliases --release fn main() { let caller = abi(MyContract, CONTRACT_ID); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_increment_contract/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_increment_contract/src/main.sw index eda83505ee..3d09a4d0d1 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_increment_contract/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_increment_contract/src/main.sw @@ -6,7 +6,7 @@ use dynamic_contract_call::*; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0xd1b4047af7ef111c023ab71069e01dc2abfde487c0a0ce1268e4f447e6c6e4c2; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0xbd7b975dfe17604529e218dbce7a3643b6173dc6d485d1c11d1b3c7f3beae110; // AUTO-CONTRACT-ID ../../test_contracts/increment_contract --release +const CONTRACT_ID = 0x617b0e57c92cc91129f3bbb35ddffd2a05adf7e8424eb3ae939cb0fb3ff2a7e8; // AUTO-CONTRACT-ID ../../test_contracts/increment_contract --release fn main() -> bool { let the_abi = abi(Incrementor, CONTRACT_ID); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_storage_enum/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_storage_enum/src/main.sw index e858bfef09..0c0ee9f83a 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_storage_enum/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/call_storage_enum/src/main.sw @@ -5,7 +5,7 @@ use storage_enum_abi::*; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0xc601d11767195485a6654d566c67774134668863d8c797a8c69e8778fb1f89e9; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0x389d32c6f736950a7c3cd70a4d06991d1de11b5d233b0129febea779b8a8d217; // AUTO-CONTRACT-ID ../../test_contracts/storage_enum_contract --release +const CONTRACT_ID = 0xc8de8a6f185095fe1ae870db2b708df2a44fbf13233ee3cebdb60ba335589c9a; // AUTO-CONTRACT-ID ../../test_contracts/storage_enum_contract --release fn main() -> u64 { let caller = abi(StorageEnum, CONTRACT_ID); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/caller_auth_test/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/caller_auth_test/src/main.sw index 177239dbe7..eb4896362f 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/caller_auth_test/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/caller_auth_test/src/main.sw @@ -5,7 +5,7 @@ use auth_testing_abi::AuthTesting; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0xc2eec20491b53aab7232cbd27c31d15417b4e9daf0b89c74cc242ef1295f681f; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0x3ea59842d25eff64eaccd63455954eb6d87b85d62e46c42ac9f30c7fee5d374e; // AUTO-CONTRACT-ID ../../test_contracts/auth_testing_contract --release +const CONTRACT_ID = 0x1c7361535a532b2b36b357564f16707933190e7936fb3443e8fa197dee02e8fd; // AUTO-CONTRACT-ID ../../test_contracts/auth_testing_contract --release // should be false in the case of a script fn main() -> bool { diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/caller_context_test/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/caller_context_test/src/main.sw index 91f07e3000..994dbb5279 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/caller_context_test/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/caller_context_test/src/main.sw @@ -6,7 +6,7 @@ use context_testing_abi::*; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0x6054c11cda000f5990373a4d61929396165be4dfdd61d5b7bd26da60ab0d8577; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0x4404bb47772d6a57615723b2432bc2777d93f0285fb9498a091abe5755023ce9; // AUTO-CONTRACT-ID ../../test_contracts/context_testing_contract --release +const CONTRACT_ID = 0xb4fd4240a53d376d2bfa13f98856407e766f90711ffb99d577856574e32e8d3b; // AUTO-CONTRACT-ID ../../test_contracts/context_testing_contract --release fn main() -> bool { let gas: u64 = u64::max(); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/nested_struct_args_caller/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/nested_struct_args_caller/src/main.sw index f79b4f01c6..fde61d8d8f 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/nested_struct_args_caller/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/nested_struct_args_caller/src/main.sw @@ -5,7 +5,7 @@ use nested_struct_args_abi::*; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0xe63d33a1b3a6903808b379f6a41a72fa8a370e8b76626775e7d9d2f9c4c5da40; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0xd7bc72f9b3ac9af765c8f5d522766c3c19dc03bc04a9fa40314d61d4d7439cad; // AUTO-CONTRACT-ID ../../test_contracts/nested_struct_args_contract --release +const CONTRACT_ID = 0x7f7028de5ba246cf26c182536631f74230f5d6e3ab99df370e85ba749e2271b9; // AUTO-CONTRACT-ID ../../test_contracts/nested_struct_args_contract --release fn main() -> bool { let caller = abi(NestedStructArgs, CONTRACT_ID); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/storage_access_caller/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/storage_access_caller/src/main.sw index 1949257833..5759fec23d 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/storage_access_caller/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/require_contract_deployment/storage_access_caller/src/main.sw @@ -6,7 +6,7 @@ use std::hash::*; #[cfg(experimental_new_encoding = false)] const CONTRACT_ID = 0x3bc28acd66d327b8c1b9624c1fabfc07e9ffa1b5d71c2832c3bfaaf8f4b805e9; #[cfg(experimental_new_encoding = true)] -const CONTRACT_ID = 0xaa29e9ce35fe5d324c1b6bd8fb791b957dabfc26e745d60b65202b31c87aeff7; // AUTO-CONTRACT-ID ../../test_contracts/storage_access_contract --release +const CONTRACT_ID = 0xdf3edd8410770684479029baa31359437a80cd2889557689c088a39d67dd9375; // AUTO-CONTRACT-ID ../../test_contracts/storage_access_contract --release fn main() -> bool { let caller = abi(StorageAccess, CONTRACT_ID); diff --git a/test/src/ir_generation/tests/str_slice.sw b/test/src/ir_generation/tests/str_slice.sw index 34abee4ef2..df69f6c325 100644 --- a/test/src/ir_generation/tests/str_slice.sw +++ b/test/src/ir_generation/tests/str_slice.sw @@ -13,10 +13,10 @@ fn main() -> u64 { // check: v0 = get_local __ptr string<3>, $ID // check: v1 = const string<3> "abc" // check: store v1 to v0 -// check: v2 = ptr_to_int v0 to u64, -// check: v3 = get_local __ptr { u64, u64 }, $ID +// check: v2 = cast_ptr v0 to ptr, +// check: v3 = get_local __ptr { ptr, u64 }, $ID // check: v4 = const u64 0 -// check: v5 = get_elem_ptr v3, __ptr u64, v4 +// check: v5 = get_elem_ptr v3, __ptr ptr, v4 // check: store v2 to v5, // ::check-ir-optimized::