diff --git a/forc-plugins/forc-client/tests/deploy.rs b/forc-plugins/forc-client/tests/deploy.rs index 5d63f507ad5..04f852ec57e 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( - "b9443b8e389d42e551b80bb7e94adb4dd37c6985088401940035e36489c90af8", + "d54d140236c92deb6b10fb5926d0362f86654111cd8e24bb9b416a84c5eba9a5", ) .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( - "b9443b8e389d42e551b80bb7e94adb4dd37c6985088401940035e36489c90af8", + "d54d140236c92deb6b10fb5926d0362f86654111cd8e24bb9b416a84c5eba9a5", ) .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( - "b9443b8e389d42e551b80bb7e94adb4dd37c6985088401940035e36489c90af8", + "d54d140236c92deb6b10fb5926d0362f86654111cd8e24bb9b416a84c5eba9a5", ) .unwrap(), proxy: Some( ContractId::from_str( - "e597d0ef3dc3375402f32bcaa7fc66940f92c31a916e87e7eebb32fcd147d752", + "3806de177541f8e9e970640c1455bc9740a2b0248ee959a634ffe4ab6df558e2", ) .unwrap(), ), diff --git a/forc/tests/cli_integration.rs b/forc/tests/cli_integration.rs index e57c14cf7e0..4355a69ac2a 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":12408,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?; + process.exp_string(r#"[{"LogData":{"data":"0000000000000004","digest":"8005f02d43fa06e7d0585fb64c961d57e318b27a145c857bcd3a6bdb413ff7fc","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12044,"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":12408,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?; + process.exp_string(r#"[{"LogData":{"data":"0000000000000002","digest":"cd04a4754498e06db5a13c5f371f1f04ff6d2470f24aa9bd886540e5dce77f70","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12044,"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":12408,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?; + process.exp_string(r#"[{"LogData":{"data":"0000000000000004","digest":"8005f02d43fa06e7d0585fb64c961d57e318b27a145c857bcd3a6bdb413ff7fc","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12044,"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":12408,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?; + process.exp_string(r#"[{"LogData":{"data":"0000000000000002","digest":"cd04a4754498e06db5a13c5f371f1f04ff6d2470f24aa9bd886540e5dce77f70","id":"0000000000000000000000000000000000000000000000000000000000000000","is":10368,"len":8,"pc":12044,"ptr":67107840,"ra":0,"rb":1515152261580153489}}]"#)?; process.process.exit()?; Ok(()) } diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl/abi_encoding.rs b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl/abi_encoding.rs index 9ac366bf39d..2cd6691101f 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl/abi_encoding.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl/abi_encoding.rs @@ -8,6 +8,7 @@ use crate::{ }, Engines, TypeInfo, TypeParameter, }; +use itertools::Itertools; use std::collections::BTreeMap; use sway_error::{ error::CompileError, @@ -312,15 +313,16 @@ where fallback_fn: Option>, handler: &Handler, ) -> Result { - let mut code = String::new(); - let mut reads = false; let mut writes = false; // used to check for name collisions let mut contract_methods: BTreeMap> = <_>::default(); + let mut arm_by_size = BTreeMap::::default(); + // generate code + let mut method_names = String::new(); for r in contract_fns { let decl = engines.de().get(r); @@ -382,8 +384,20 @@ where }; let method_name = decl.name.as_str(); + let offset = if let Some(offset) = method_names.find(method_name) { + offset + } else { + let offset = method_names.len(); + method_names.push_str(method_name); + offset + }; + + let method_name_len = method_name.len(); + let code = arm_by_size.entry(method_name.len()).or_default(); - code.push_str(&format!("if _method_name == \"{method_name}\" {{\n")); + code.push_str(&format!(" + let is_this_method = asm(r, ptr: _method_name_ptr, name: _method_names_ptr, len: {method_name_len}) {{ addi r name i{offset}; meq r ptr r len; r: bool }}; + if is_this_method {{\n")); if args_types == "()" { code.push_str(&format!( @@ -454,10 +468,19 @@ where (false, false) => "", }; + let code = arm_by_size + .iter() + .map(|(len, code)| format!("if _method_len == {len} {{ {code} }}")) + .join(""); let code = format!( "{att} pub fn __entry() {{ + let _method_names = \"{method_names}\"; let mut _buffer = BufferReader::from_second_parameter(); - let _method_name = decode_first_param::(); + + let mut _first_param_buffer = BufferReader::from_first_parameter(); + let _method_len = _first_param_buffer.read::(); + let _method_name_ptr = _first_param_buffer.ptr(); + let _method_names_ptr = _method_names.as_ptr(); {code} {fallback} }}" diff --git a/sway-core/src/semantic_analysis/ast_node/expression/match_expression/typed/typed_match_expression.rs b/sway-core/src/semantic_analysis/ast_node/expression/match_expression/typed/typed_match_expression.rs index 0b38c6d1355..88a31331ccf 100644 --- a/sway-core/src/semantic_analysis/ast_node/expression/match_expression/typed/typed_match_expression.rs +++ b/sway-core/src/semantic_analysis/ast_node/expression/match_expression/typed/typed_match_expression.rs @@ -2,52 +2,51 @@ use crate::{ compiler_generated::INVALID_DESUGARED_MATCHED_EXPRESSION_SIGNAL, language::{ parsed::*, - ty::{ - self, TyAsmRegisterDeclaration, TyExpression, TyExpressionVariant, - TyIntrinsicFunctionKind, - }, - AsmOp, AsmRegister, + ty::{self, TyExpression}, }, semantic_analysis::{ ast_node::expression::typed_expression::instantiate_if_expression, expression::match_expression::typed::instantiate::Instantiate, TypeCheckContext, }, - CompileError, TypeEngine, TypeId, TypeInfo, + CompileError, TypeId, }; -use std::{collections::BTreeMap, ops::ControlFlow}; +use std::ops::ControlFlow; use sway_error::handler::{ErrorEmitted, Handler}; -use sway_types::{BaseIdent, Ident, Span, Spanned}; +use sway_types::{Span, Spanned}; -// Enable this to see a pseudo-code printed to understand what is being generated. -const RADIX_TREE_DEBUG: bool = true; - -#[derive(Default, Debug, Clone)] -struct TrieNode { - output: Option, - previous: Option, - next: BTreeMap, -} - -struct Trie { - nodes: Vec, -} +// Trie for matching strings is disabled as it is not generating the best possible code. +// Sometimes mac=tching by the trie is actually worse than comparing each individually -fn revert(type_engine: &TypeEngine) -> TyExpression { - TyExpression { - expression: TyExpressionVariant::IntrinsicFunction(TyIntrinsicFunctionKind { - kind: sway_ast::Intrinsic::Revert, - arguments: vec![TyExpression { - expression: TyExpressionVariant::Literal(crate::language::Literal::U64(17)), - return_type: type_engine.id_of_u64(), - span: Span::dummy(), - }], - type_arguments: vec![], - span: Span::dummy(), - }), - return_type: type_engine.id_of_never(), - span: Span::dummy(), - } -} +// Enable this to see a pseudo-code printed to understand what is being generated. +// const RADIX_TRIE_DEBUG: bool = false; + +// #[derive(Default, Debug, Clone)] +// struct TrieNode { +// output: Option, +// previous: Option, +// next: BTreeMap, +// } + +// struct Trie { +// nodes: Vec, +// } + +// fn revert(type_engine: &TypeEngine) -> TyExpression { +// TyExpression { +// expression: TyExpressionVariant::IntrinsicFunction(TyIntrinsicFunctionKind { +// kind: sway_ast::Intrinsic::Revert, +// arguments: vec![TyExpression { +// expression: TyExpressionVariant::Literal(crate::language::Literal::U64(17)), +// return_type: type_engine.id_of_u64(), +// span: Span::dummy(), +// }], +// type_arguments: vec![], +// span: Span::dummy(), +// }), +// return_type: type_engine.id_of_never(), +// span: Span::dummy(), +// } +// } impl ty::TyMatchExpression { pub(crate) fn type_check( @@ -109,466 +108,460 @@ impl ty::TyMatchExpression { ); } - let typed_if_exp = - handler.scope( - |handler| match &*ctx.engines().te().get(self.value_type_id) { - TypeInfo::StringSlice => self.desugar_to_radix_trie(ctx), - _ => self.desugar_to_typed_if_expression(instantiate, ctx, handler), - }, - )?; + let typed_if_exp = handler + .scope(|handler| self.desugar_to_typed_if_expression(instantiate, ctx, handler))?; Ok(typed_if_exp) } - fn desugar_to_radix_trie( - &self, - mut ctx: TypeCheckContext<'_>, - ) -> Result { - let type_engine = ctx.engines.te(); - - let branch_return_type_id = self - .branches - .iter() - .map(|x| x.result.return_type) - .next() - .unwrap(); - - let matched_value = self - .branches - .iter() - .flat_map(|x| match &x.condition.as_ref().map(|x| &x.expression) { - Some(TyExpressionVariant::FunctionApplication { arguments, .. }) => { - Some(&arguments[0].1) - } - _ => None, - }) - .next() - .unwrap(); - - // the block for the wildcard arm - let wildcard_return_expr = self - .branches - .iter() - .filter(|x| x.condition.is_none()) - .map(|x| x.result.clone()) - .next() - .unwrap_or_else(|| revert(type_engine)); - - // All the match string slices, ignoring the wildcard - let match_arms_string_slices = self - .branches - .iter() - .flat_map(|x| match &x.condition.as_ref().map(|x| &x.expression) { - Some(TyExpressionVariant::FunctionApplication { arguments, .. }) => { - match &arguments[1].1.expression { - TyExpressionVariant::Literal(crate::language::Literal::String(v)) => { - Some(v.as_str().to_string()) - } - _ => None, - } - } - _ => None, - }) - .collect::>(); - - // group match arms by size of the arm string slice - let match_arms_by_size = match_arms_string_slices.iter().enumerate().fold( - BTreeMap::>::new(), - |mut map, (i, item)| { - map.entry(item.len()).or_default().push((item.clone(), i)); - map - }, - ); - - // create and compress all tries. One per arm size - let tries = match_arms_by_size - .values() - .map(|branches| self.generate_radix_trie(branches).unwrap()) - .collect::>(); - - // Navigate all valid nodes and collect string pieces. - // Then pack them starting from the biggest. - let mut string_pieces = tries - .iter() - .flat_map(|x| x.nodes.iter()) - .flat_map(|x| x.next.keys().cloned()) - .collect::>(); - string_pieces.sort_by(|l, r| l.len().cmp(&r.len()).reverse()); - let packed_strings = string_pieces - .into_iter() - .fold(String::new(), |mut pack, item| { - if !pack.contains(&item) { - pack.push_str(&item); - } - pack - }); - - if RADIX_TREE_DEBUG { - println!("let packed_string = {packed_strings:?}"); - } - - // Now create the outer expression checking the size of the string slice - let mut block = wildcard_return_expr.clone(); - - for ((k, _), trie) in match_arms_by_size.into_iter().zip(tries.into_iter()) { - if RADIX_TREE_DEBUG { - println!("if str.len() == {k}"); - } - - let expression = TyExpressionVariant::AsmExpression { - registers: vec![ - TyAsmRegisterDeclaration { - name: Ident::new_no_span("is_eq".into()), - initializer: None, - }, - TyAsmRegisterDeclaration { - name: Ident::new_no_span("slice".into()), - initializer: Some(matched_value.clone()), - }, - TyAsmRegisterDeclaration { - name: Ident::new_no_span("len".into()), - initializer: None, - }, - TyAsmRegisterDeclaration { - name: Ident::new_no_span("expected_len".into()), - initializer: Some(TyExpression { - expression: TyExpressionVariant::Literal( - crate::language::Literal::U64(k as u64), - ), - return_type: type_engine.id_of_u64(), - span: Span::dummy(), - }), - }, - ], - body: vec![ - AsmOp { - op_name: Ident::new_no_span("lw".into()), - op_args: vec![ - BaseIdent::new_no_span("len".into()), - BaseIdent::new_no_span("slice".into()), - ], - immediate: Some(BaseIdent::new_no_span("i1".into())), - span: Span::dummy(), - }, - AsmOp { - op_name: Ident::new_no_span("eq".into()), - op_args: vec![ - BaseIdent::new_no_span("is_eq".into()), - BaseIdent::new_no_span("len".into()), - BaseIdent::new_no_span("expected_len".into()), - ], - immediate: None, - span: Span::dummy(), - }, - ], - returns: Some(( - AsmRegister { - name: "is_eq".into(), - }, - Span::dummy(), - )), - whole_block_span: self.span.clone(), - }; - - let then_node = self - .generate_radix_tree_checks( - ctx.by_ref(), - matched_value, - branch_return_type_id, - wildcard_return_expr.clone(), - trie, - &packed_strings, - ) - .unwrap(); - - block = TyExpression { - expression: TyExpressionVariant::IfExp { - condition: Box::new(TyExpression { - expression, - return_type: type_engine.id_of_bool(), - span: self.span.clone(), - }), - then: Box::new(then_node), - r#else: Some(Box::new(block)), - }, - return_type: branch_return_type_id, - span: self.span.clone(), - }; - } - - if RADIX_TREE_DEBUG { - println!("return wildcard branch"); - } - - Ok(block) - } - - #[allow(clippy::too_many_arguments)] - fn generate_radix_trie(&self, branches: &[(String, usize)]) -> Result { - let mut nodes = vec![TrieNode::default()]; - - for (b, i) in branches.iter() { - let mut current = 0; - for c in b.chars() { - let c = c.to_string(); - if let Some(next) = nodes[current].next.get(&c) { - current = *next; - continue; - } - - let next = nodes.len(); - nodes[current].next.insert(c, next); - current = next; - nodes.push(TrieNode::default()); - } - - nodes[current].output = Some(*i); - } - - // compress trie - let mut q = vec![0]; - while let Some(i) = q.pop() { - let mut current = nodes[i].clone(); - if current.next.len() == 1 { - let edge = current.next.pop_first().unwrap(); - let mut next = nodes[edge.1].clone(); - if next.next.len() == 1 { - let next_edge = next.next.pop_first().unwrap(); - let compressed_key = format!("{}{}", edge.0, next_edge.0); - - nodes[i].next.clear(); - nodes[i].next.insert(compressed_key, next_edge.1); - nodes[i].output = next.output.take(); - - q.push(i); - } else { - nodes[edge.1].previous = Some(i); - q.push(edge.1); - } - } else { - for (_, v) in current.next.iter() { - nodes[*v].previous = Some(i); - q.push(*v); - } - } - } - - Ok(Trie { nodes }) - } - - #[allow(clippy::too_many_arguments)] - fn generate_radix_tree_checks( - &self, - ctx: TypeCheckContext<'_>, - matched_value: &TyExpression, - branch_return_type_id: TypeId, - wildcard_return_expr: TyExpression, - trie: Trie, - packed_strings: &str, - ) -> Result { - let type_engine = ctx.engines.te(); - - let packed_strings_expr = TyExpression { - expression: TyExpressionVariant::Literal(crate::language::Literal::String( - Span::from_string(packed_strings.to_string()), - )), - return_type: type_engine.id_of_string_slice(), - span: Span::dummy(), - }; - - let expr = self.generate_radrix_trie_code( - matched_value, - packed_strings, - &packed_strings_expr, - &trie.nodes, - 0, - 0, - type_engine.id_of_bool(), - type_engine.id_of_u64(), - branch_return_type_id, - 1, - wildcard_return_expr, - ); - - Ok(expr) - } - - #[allow(clippy::too_many_arguments)] - fn generate_radrix_trie_code( - &self, - matched_value: &TyExpression, - packed_strings: &str, - packed_strings_expr: &TyExpression, - nodes: &[TrieNode], - slice_pos: usize, - current_node_index: usize, - bool_type_id: TypeId, - u64_type_id: TypeId, - branch_return_type_id: TypeId, - depth: usize, - block_when_all_fail: TyExpression, - ) -> TyExpression { - let current = &nodes[current_node_index]; - - if let Some(output) = current.output { - assert!(current.next.is_empty()); - - if RADIX_TREE_DEBUG { - println!("{}return branch {:?}", " ".repeat(depth * 4), output); - } - - let branch = &self.branches[output]; - return branch.result.clone(); - } - - let mut block = block_when_all_fail.clone(); - - for (prefix, next_node_index) in current.next.iter().rev() { - let start = current_node_index; - let end = current_node_index + prefix.len(); - let eq_len: u64 = end as u64 - start as u64; - - let prefix_pos = packed_strings - .find(prefix) - .expect("prefix should be inside this string"); - - if RADIX_TREE_DEBUG { - println!( - "{}if str[{start}..{end}] == \"{prefix}\" at packed_string[{prefix_pos}]", - " ".repeat(depth * 4), - ); - } - - let then_node = self.generate_radrix_trie_code( - matched_value, - packed_strings, - packed_strings_expr, - nodes, - end, - *next_node_index, - bool_type_id, - u64_type_id, - branch_return_type_id, - depth + 1, - block_when_all_fail.clone(), - ); - - let prefix_pos = packed_strings - .find(prefix) - .expect("prefix should be inside this string"); - - let expression = TyExpressionVariant::AsmExpression { - registers: vec![ - TyAsmRegisterDeclaration { - name: Ident::new_no_span("slice".into()), - initializer: Some(matched_value.clone()), - }, - TyAsmRegisterDeclaration { - name: Ident::new_no_span("prefix".into()), - initializer: Some(packed_strings_expr.clone()), - }, - TyAsmRegisterDeclaration { - name: Ident::new_no_span("slice_ptr".into()), - initializer: None, - }, - TyAsmRegisterDeclaration { - name: Ident::new_no_span("prefix_ptr".into()), - initializer: None, - }, - TyAsmRegisterDeclaration { - name: Ident::new_no_span("len".into()), - initializer: Some(TyExpression { - expression: TyExpressionVariant::Literal( - crate::language::Literal::U64(eq_len), - ), - return_type: u64_type_id, - span: Span::dummy(), - }), - }, - TyAsmRegisterDeclaration { - name: Ident::new_no_span("is_eq".into()), - initializer: None, - }, - ], - body: vec![ - AsmOp { - op_name: Ident::new_no_span("lw".into()), - op_args: vec![ - BaseIdent::new_no_span("slice_ptr".into()), - BaseIdent::new_no_span("slice".into()), - ], - immediate: Some(BaseIdent::new_no_span("i0".into())), - span: Span::dummy(), - }, - AsmOp { - op_name: Ident::new_no_span("addi".into()), - op_args: vec![ - BaseIdent::new_no_span("slice_ptr".into()), - BaseIdent::new_no_span("slice_ptr".into()), - ], - immediate: Some(BaseIdent::new_no_span(format!("i{slice_pos}"))), - span: Span::dummy(), - }, - AsmOp { - op_name: Ident::new_no_span("lw".into()), - op_args: vec![ - BaseIdent::new_no_span("prefix_ptr".into()), - BaseIdent::new_no_span("prefix".into()), - ], - immediate: Some(BaseIdent::new_no_span("i0".into())), - span: Span::dummy(), - }, - AsmOp { - op_name: Ident::new_no_span("addi".into()), - op_args: vec![ - BaseIdent::new_no_span("prefix_ptr".into()), - BaseIdent::new_no_span("prefix_ptr".into()), - ], - immediate: Some(BaseIdent::new_no_span(format!("i{prefix_pos}"))), - span: Span::dummy(), - }, - AsmOp { - op_name: Ident::new_no_span("meq".into()), - op_args: vec![ - BaseIdent::new_no_span("is_eq".into()), - BaseIdent::new_no_span("slice_ptr".into()), - BaseIdent::new_no_span("prefix_ptr".into()), - BaseIdent::new_no_span("len".into()), - ], - immediate: None, - span: Span::dummy(), - }, - ], - returns: Some(( - AsmRegister { - name: "is_eq".into(), - }, - Span::dummy(), - )), - whole_block_span: Span::dummy(), - }; - - block = TyExpression { - expression: TyExpressionVariant::IfExp { - condition: Box::new(TyExpression { - expression, - return_type: bool_type_id, - span: Span::dummy(), - }), - then: Box::new(then_node), - r#else: Some(Box::new(block)), - }, - return_type: branch_return_type_id, - span: Span::dummy(), - }; - } - - if RADIX_TREE_DEBUG { - println!("{}return wildcard branch", " ".repeat(depth * 4),); - } - - block - } + // fn desugar_to_radix_trie( + // &self, + // mut ctx: TypeCheckContext<'_>, + // ) -> Result { + // let type_engine = ctx.engines.te(); + + // let branch_return_type_id = self + // .branches + // .iter() + // .map(|x| x.result.return_type) + // .next() + // .unwrap(); + + // let matched_value = self + // .branches + // .iter() + // .flat_map(|x| match &x.condition.as_ref().map(|x| &x.expression) { + // Some(TyExpressionVariant::FunctionApplication { arguments, .. }) => { + // Some(&arguments[0].1) + // } + // _ => None, + // }) + // .next() + // .unwrap(); + + // // the block for the wildcard arm + // let wildcard_return_expr = self + // .branches + // .iter() + // .filter(|x| x.condition.is_none()) + // .map(|x| x.result.clone()) + // .next() + // .unwrap_or_else(|| revert(type_engine)); + + // // All the match string slices, ignoring the wildcard + // let match_arms_string_slices = self + // .branches + // .iter() + // .flat_map(|x| match &x.condition.as_ref().map(|x| &x.expression) { + // Some(TyExpressionVariant::FunctionApplication { arguments, .. }) => { + // match &arguments[1].1.expression { + // TyExpressionVariant::Literal(crate::language::Literal::String(v)) => { + // Some(v.as_str().to_string()) + // } + // _ => None, + // } + // } + // _ => None, + // }) + // .collect::>(); + + // // group match arms by size of the arm string slice + // let match_arms_by_size = match_arms_string_slices.iter().enumerate().fold( + // BTreeMap::>::new(), + // |mut map, (i, item)| { + // map.entry(item.len()).or_default().push((item.clone(), i)); + // map + // }, + // ); + + // // create and compress all tries. One per arm size + // let tries = match_arms_by_size + // .values() + // .map(|branches| self.generate_radix_trie(branches).unwrap()) + // .collect::>(); + + // // Navigate all valid nodes and collect string pieces. + // // Then pack them starting from the biggest. + // let mut string_pieces = tries + // .iter() + // .flat_map(|x| x.nodes.iter()) + // .flat_map(|x| x.next.keys().cloned()) + // .collect::>(); + // string_pieces.sort_by(|l, r| l.len().cmp(&r.len()).reverse()); + // let packed_strings = string_pieces + // .into_iter() + // .fold(String::new(), |mut pack, item| { + // if !pack.contains(&item) { + // pack.push_str(&item); + // } + // pack + // }); + + // if RADIX_TRIE_DEBUG { + // println!("let packed_string = {packed_strings:?}"); + // } + + // // Now create the outer expression checking the size of the string slice + // let mut block = wildcard_return_expr.clone(); + + // for ((k, _), trie) in match_arms_by_size.into_iter().zip(tries.into_iter()) { + // if RADIX_TRIE_DEBUG { + // println!("if str.len() == {k}"); + // } + + // let expression = TyExpressionVariant::AsmExpression { + // registers: vec![ + // TyAsmRegisterDeclaration { + // name: Ident::new_no_span("is_eq".into()), + // initializer: None, + // }, + // TyAsmRegisterDeclaration { + // name: Ident::new_no_span("slice".into()), + // initializer: Some(matched_value.clone()), + // }, + // TyAsmRegisterDeclaration { + // name: Ident::new_no_span("len".into()), + // initializer: None, + // }, + // TyAsmRegisterDeclaration { + // name: Ident::new_no_span("expected_len".into()), + // initializer: Some(TyExpression { + // expression: TyExpressionVariant::Literal( + // crate::language::Literal::U64(k as u64), + // ), + // return_type: type_engine.id_of_u64(), + // span: Span::dummy(), + // }), + // }, + // ], + // body: vec![ + // AsmOp { + // op_name: Ident::new_no_span("lw".into()), + // op_args: vec![ + // BaseIdent::new_no_span("len".into()), + // BaseIdent::new_no_span("slice".into()), + // ], + // immediate: Some(BaseIdent::new_no_span("i1".into())), + // span: Span::dummy(), + // }, + // AsmOp { + // op_name: Ident::new_no_span("eq".into()), + // op_args: vec![ + // BaseIdent::new_no_span("is_eq".into()), + // BaseIdent::new_no_span("len".into()), + // BaseIdent::new_no_span("expected_len".into()), + // ], + // immediate: None, + // span: Span::dummy(), + // }, + // ], + // returns: Some(( + // AsmRegister { + // name: "is_eq".into(), + // }, + // Span::dummy(), + // )), + // whole_block_span: self.span.clone(), + // }; + + // let then_node = self + // .generate_radix_tree_checks( + // ctx.by_ref(), + // matched_value, + // branch_return_type_id, + // wildcard_return_expr.clone(), + // trie, + // &packed_strings, + // ) + // .unwrap(); + + // block = TyExpression { + // expression: TyExpressionVariant::IfExp { + // condition: Box::new(TyExpression { + // expression, + // return_type: type_engine.id_of_bool(), + // span: self.span.clone(), + // }), + // then: Box::new(then_node), + // r#else: Some(Box::new(block)), + // }, + // return_type: branch_return_type_id, + // span: self.span.clone(), + // }; + // } + + // if RADIX_TRIE_DEBUG { + // println!("return wildcard branch"); + // } + + // Ok(block) + // } + + // fn generate_radix_trie(&self, branches: &[(String, usize)]) -> Result { + // let mut nodes = vec![TrieNode::default()]; + + // for (b, i) in branches.iter() { + // let mut current = 0; + // for c in b.chars() { + // let c = c.to_string(); + // if let Some(next) = nodes[current].next.get(&c) { + // current = *next; + // continue; + // } + + // let next = nodes.len(); + // nodes[current].next.insert(c, next); + // current = next; + // nodes.push(TrieNode::default()); + // } + + // nodes[current].output = Some(*i); + // } + + // // compress trie + // let mut q = vec![0]; + // while let Some(i) = q.pop() { + // let mut current = nodes[i].clone(); + // if current.next.len() == 1 { + // let edge = current.next.pop_first().unwrap(); + // let mut next = nodes[edge.1].clone(); + // if next.next.len() == 1 { + // let next_edge = next.next.pop_first().unwrap(); + // let compressed_key = format!("{}{}", edge.0, next_edge.0); + + // nodes[i].next.clear(); + // nodes[i].next.insert(compressed_key, next_edge.1); + // nodes[i].output = next.output.take(); + + // q.push(i); + // } else { + // nodes[edge.1].previous = Some(i); + // q.push(edge.1); + // } + // } else { + // for (_, v) in current.next.iter() { + // nodes[*v].previous = Some(i); + // q.push(*v); + // } + // } + // } + + // Ok(Trie { nodes }) + // } + + // #[allow(clippy::too_many_arguments)] + // fn generate_radix_tree_checks( + // &self, + // ctx: TypeCheckContext<'_>, + // matched_value: &TyExpression, + // branch_return_type_id: TypeId, + // wildcard_return_expr: TyExpression, + // trie: Trie, + // packed_strings: &str, + // ) -> Result { + // let type_engine = ctx.engines.te(); + + // let packed_strings_expr = TyExpression { + // expression: TyExpressionVariant::Literal(crate::language::Literal::String( + // Span::from_string(packed_strings.to_string()), + // )), + // return_type: type_engine.id_of_string_slice(), + // span: Span::dummy(), + // }; + + // let expr = self.generate_radrix_trie_code( + // matched_value, + // packed_strings, + // &packed_strings_expr, + // &trie.nodes, + // 0, + // 0, + // type_engine.id_of_bool(), + // type_engine.id_of_u64(), + // branch_return_type_id, + // 1, + // wildcard_return_expr, + // ); + + // Ok(expr) + // } + + // #[allow(clippy::too_many_arguments)] + // fn generate_radrix_trie_code( + // &self, + // matched_value: &TyExpression, + // packed_strings: &str, + // packed_strings_expr: &TyExpression, + // nodes: &[TrieNode], + // slice_pos: usize, + // current_node_index: usize, + // bool_type_id: TypeId, + // u64_type_id: TypeId, + // branch_return_type_id: TypeId, + // depth: usize, + // block_when_all_fail: TyExpression, + // ) -> TyExpression { + // let current = &nodes[current_node_index]; + + // if let Some(output) = current.output { + // assert!(current.next.is_empty()); + + // if RADIX_TRIE_DEBUG { + // println!("{}return branch {:?}", " ".repeat(depth * 4), output); + // } + + // let branch = &self.branches[output]; + // return branch.result.clone(); + // } + + // let mut block = block_when_all_fail.clone(); + + // for (prefix, next_node_index) in current.next.iter().rev() { + // let start = current_node_index; + // let end = current_node_index + prefix.len(); + // let eq_len: u64 = end as u64 - start as u64; + + // let prefix_pos = packed_strings + // .find(prefix) + // .expect("prefix should be inside this string"); + + // if RADIX_TRIE_DEBUG { + // println!( + // "{}if str[{start}..{end}] == \"{prefix}\" at packed_string[{prefix_pos}]", + // " ".repeat(depth * 4), + // ); + // } + + // let then_node = self.generate_radrix_trie_code( + // matched_value, + // packed_strings, + // packed_strings_expr, + // nodes, + // end, + // *next_node_index, + // bool_type_id, + // u64_type_id, + // branch_return_type_id, + // depth + 1, + // block_when_all_fail.clone(), + // ); + + // let prefix_pos = packed_strings + // .find(prefix) + // .expect("prefix should be inside this string"); + + // let expression = TyExpressionVariant::AsmExpression { + // registers: vec![ + // TyAsmRegisterDeclaration { + // name: Ident::new_no_span("slice".into()), + // initializer: Some(matched_value.clone()), + // }, + // TyAsmRegisterDeclaration { + // name: Ident::new_no_span("prefix".into()), + // initializer: Some(packed_strings_expr.clone()), + // }, + // TyAsmRegisterDeclaration { + // name: Ident::new_no_span("slice_ptr".into()), + // initializer: None, + // }, + // TyAsmRegisterDeclaration { + // name: Ident::new_no_span("prefix_ptr".into()), + // initializer: None, + // }, + // TyAsmRegisterDeclaration { + // name: Ident::new_no_span("len".into()), + // initializer: Some(TyExpression { + // expression: TyExpressionVariant::Literal( + // crate::language::Literal::U64(eq_len), + // ), + // return_type: u64_type_id, + // span: Span::dummy(), + // }), + // }, + // TyAsmRegisterDeclaration { + // name: Ident::new_no_span("is_eq".into()), + // initializer: None, + // }, + // ], + // body: vec![ + // AsmOp { + // op_name: Ident::new_no_span("lw".into()), + // op_args: vec![ + // BaseIdent::new_no_span("slice_ptr".into()), + // BaseIdent::new_no_span("slice".into()), + // ], + // immediate: Some(BaseIdent::new_no_span("i0".into())), + // span: Span::dummy(), + // }, + // AsmOp { + // op_name: Ident::new_no_span("addi".into()), + // op_args: vec![ + // BaseIdent::new_no_span("slice_ptr".into()), + // BaseIdent::new_no_span("slice_ptr".into()), + // ], + // immediate: Some(BaseIdent::new_no_span(format!("i{slice_pos}"))), + // span: Span::dummy(), + // }, + // AsmOp { + // op_name: Ident::new_no_span("lw".into()), + // op_args: vec![ + // BaseIdent::new_no_span("prefix_ptr".into()), + // BaseIdent::new_no_span("prefix".into()), + // ], + // immediate: Some(BaseIdent::new_no_span("i0".into())), + // span: Span::dummy(), + // }, + // AsmOp { + // op_name: Ident::new_no_span("addi".into()), + // op_args: vec![ + // BaseIdent::new_no_span("prefix_ptr".into()), + // BaseIdent::new_no_span("prefix_ptr".into()), + // ], + // immediate: Some(BaseIdent::new_no_span(format!("i{prefix_pos}"))), + // span: Span::dummy(), + // }, + // AsmOp { + // op_name: Ident::new_no_span("meq".into()), + // op_args: vec![ + // BaseIdent::new_no_span("is_eq".into()), + // BaseIdent::new_no_span("slice_ptr".into()), + // BaseIdent::new_no_span("prefix_ptr".into()), + // BaseIdent::new_no_span("len".into()), + // ], + // immediate: None, + // span: Span::dummy(), + // }, + // ], + // returns: Some(( + // AsmRegister { + // name: "is_eq".into(), + // }, + // Span::dummy(), + // )), + // whole_block_span: Span::dummy(), + // }; + + // block = TyExpression { + // expression: TyExpressionVariant::IfExp { + // condition: Box::new(TyExpression { + // expression, + // return_type: bool_type_id, + // span: Span::dummy(), + // }), + // then: Box::new(then_node), + // r#else: Some(Box::new(block)), + // }, + // return_type: branch_return_type_id, + // span: Span::dummy(), + // }; + // } + + // if RADIX_TRIE_DEBUG { + // println!("{}return wildcard branch", " ".repeat(depth * 4),); + // } + + // block + // } fn desugar_to_typed_if_expression( &self, diff --git a/sway-ir/src/parser.rs b/sway-ir/src/parser.rs index bfcf884144c..2c315017fbe 100644 --- a/sway-ir/src/parser.rs +++ b/sway-ir/src/parser.rs @@ -1263,7 +1263,7 @@ mod ir_builder { }, ) .collect(); - let md_idx = meta_idx.map(|mdi| self.md_map.get(&mdi).unwrap()).copied(); + let md_idx = meta_idx.and_then(|mdi| self.md_map.get(&mdi)).copied(); let return_type = return_type.to_ir_type(context); block .append(context) diff --git a/sway-lib-std/src/codec.sw b/sway-lib-std/src/codec.sw index 1b45e57a97f..f3a0d4a2757 100644 --- a/sway-lib-std/src/codec.sw +++ b/sway-lib-std/src/codec.sw @@ -156,6 +156,10 @@ impl BufferReader { { T::abi_decode(self) } + + pub fn ptr(self) -> raw_ptr { + self.ptr + } } // Encode diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap index 176de197a7e..15f6e0847a4 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap @@ -1115,12 +1115,12 @@ script { !182 = span !160 1257 1262 !183 = (!157 !158 !179 !180 !182) !184 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert/src/codec.sw" -!185 = span !184 70930 71103 -!186 = fn_name_span !184 70937 70947 +!185 = span !184 70988 71161 +!186 = fn_name_span !184 70995 71005 !187 = (!185 !186 !69) -!188 = span !184 71045 71049 -!189 = span !184 71045 71055 -!190 = fn_call_path_span !184 71050 71053 +!188 = span !184 71103 71107 +!189 = span !184 71103 71113 +!190 = fn_call_path_span !184 71108 71111 !191 = (!189 !190) !192 = span !160 2922 2926 !193 = (!189 !190 !192) @@ -1131,9 +1131,9 @@ script { !198 = (!189 !190 !194 !195 !197) !199 = span !160 2928 2929 !200 = (!189 !190 !199) -!201 = span !184 71057 71061 -!202 = span !184 71057 71073 -!203 = fn_call_path_span !184 71062 71065 +!201 = span !184 71115 71119 +!202 = span !184 71115 71131 +!203 = fn_call_path_span !184 71120 71123 !204 = (!202 !203) !205 = span !160 3420 3424 !206 = (!202 !203 !205) @@ -1155,39 +1155,39 @@ script { !222 = (!202 !203 !213 !214 !221) !223 = (!202 !203 !213 !214) !224 = (!202 !203 !213 !214) -!225 = span !184 71020 71074 -!226 = fn_call_path_span !184 71020 71044 +!225 = span !184 71078 71132 +!226 = fn_call_path_span !184 71078 71102 !227 = (!225 !226) !228 = span !184 750 753 !229 = (!225 !226 !228) !230 = span !184 735 755 !231 = (!225 !226 !230) -!232 = span !184 71003 71075 -!233 = span !184 71094 71100 -!234 = span !184 71080 71101 -!235 = fn_call_path_span !184 71080 71093 +!232 = span !184 71061 71133 +!233 = span !184 71152 71158 +!234 = span !184 71138 71159 +!235 = fn_call_path_span !184 71138 71151 !236 = (!234 !235) -!237 = span !184 89756 89796 +!237 = span !184 89814 89854 !238 = (!234 !235 !237) -!239 = span !184 89776 89796 +!239 = span !184 89834 89854 !240 = (!234 !235 !237) -!241 = span !184 89822 89835 +!241 = span !184 89880 89893 !242 = (!234 !235 !241) -!243 = span !184 89806 89836 +!243 = span !184 89864 89894 !244 = (!234 !235 !243) -!245 = span !184 89921 89926 +!245 = span !184 89979 89984 !246 = (!234 !235 !245) -!247 = span !184 89845 89928 +!247 = span !184 89903 89986 !248 = (!234 !235 !247) !249 = (!234 !235 !247) -!250 = span !184 89938 89952 +!250 = span !184 89996 90010 !251 = (!234 !235 !250) -!252 = span !184 89950 89951 +!252 = span !184 90008 90009 !253 = (!234 !235 !250) -!254 = span !184 89968 89969 +!254 = span !184 90026 90027 !255 = (!234 !235 !254) -!256 = span !184 89968 89973 -!257 = fn_call_path_span !184 89970 89971 +!256 = span !184 90026 90031 +!257 = fn_call_path_span !184 90028 90029 !258 = (!234 !235 !256 !257) !259 = (!234 !235 !256 !257) !260 = (!234 !235 !256 !257) @@ -1198,27 +1198,27 @@ script { !265 = (!234 !235 !256 !257 !264) !266 = (!234 !235 !256 !257) !267 = (!234 !235 !256 !257) -!268 = span !184 90017 90022 +!268 = span !184 90075 90080 !269 = (!234 !235 !268) -!270 = span !184 90024 90025 +!270 = span !184 90082 90083 !271 = (!234 !235 !270) -!272 = span !184 89988 90027 +!272 = span !184 90046 90085 !273 = (!234 !235 !272) !274 = (!234 !235 !272) -!275 = span !184 90048 90054 +!275 = span !184 90106 90112 !276 = (!234 !235 !275) -!277 = span !184 90048 90068 -!278 = fn_call_path_span !184 90055 90061 +!277 = span !184 90106 90126 +!278 = fn_call_path_span !184 90113 90119 !279 = (!234 !235 !277 !278) !280 = span !184 3973 3977 !281 = (!234 !235 !277 !278 !280) !282 = span !184 3959 3978 !283 = fn_call_path_span !184 3959 3972 !284 = (!234 !235 !277 !278 !282 !283) -!285 = span !184 72720 72726 +!285 = span !184 72778 72784 !286 = (!234 !235 !277 !278 !282 !283 !285) -!287 = span !184 72720 72739 -!288 = fn_call_path_span !184 72727 72731 +!287 = span !184 72778 72797 +!288 = fn_call_path_span !184 72785 72789 !289 = (!234 !235 !277 !278 !282 !283 !287 !288) !290 = span !184 3371 3399 !291 = (!234 !235 !277 !278 !282 !283 !287 !288 !290) @@ -1333,17 +1333,17 @@ script { !400 = (!234 !235 !277 !278 !282 !283 !287 !288 !371 !372) !401 = (!234 !235 !277 !278 !282 !283 !287 !288) !402 = (!234 !235 !277 !278 !282 !283 !287 !288) -!403 = span !184 90041 90045 +!403 = span !184 90099 90103 !404 = (!234 !235 !403) -!405 = span !184 90040 90068 +!405 = span !184 90098 90126 !406 = (!234 !235 !405) -!407 = span !184 90082 90083 +!407 = span !184 90140 90141 !408 = (!234 !235 !407) -!409 = span !184 90082 90088 -!410 = fn_call_path_span !184 90084 90086 +!409 = span !184 90140 90146 +!410 = fn_call_path_span !184 90142 90144 !411 = (!234 !235 !409 !410) !412 = (!234 !235 !409 !410) -!413 = span !184 90087 90088 +!413 = span !184 90145 90146 !414 = (!234 !235 !409 !410) !415 = span !28 1322 1326 !416 = (!234 !235 !409 !410 !415) @@ -1354,7 +1354,7 @@ script { !421 = (!234 !235 !409 !410) !422 = (!234 !235 !409) !423 = (!234 !235 !409) -!424 = span !184 90110 90115 +!424 = span !184 90168 90173 !425 = (!234 !235 !424) !426 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert/src/logging.sw" !427 = span !426 591 596 @@ -1362,10 +1362,10 @@ script { !429 = fn_name_span !426 584 587 !430 = (!428 !429) !431 = span !426 642 647 -!432 = span !184 70852 70856 +!432 = span !184 70910 70914 !433 = (!431 !432) -!434 = span !184 70868 70881 -!435 = fn_call_path_span !184 70868 70879 +!434 = span !184 70926 70939 +!435 = fn_call_path_span !184 70926 70937 !436 = (!431 !434 !435) !437 = (!431 !434 !435) !438 = (!431 !434 !435) @@ -1377,11 +1377,11 @@ script { !444 = span !184 191 254 !445 = (!431 !434 !435 !444) !446 = (!431 !434 !435) -!447 = span !184 70852 70882 -!448 = fn_call_path_span !184 70857 70867 +!447 = span !184 70910 70940 +!448 = fn_call_path_span !184 70915 70925 !449 = (!431 !447 !448) !450 = (!431 !447 !448) -!451 = span !184 5301 5307 +!451 = span !184 5359 5365 !452 = (!431 !447 !448 !451) !453 = span !184 87 114 !454 = (!431 !447 !448 !453) @@ -1392,7 +1392,7 @@ script { !459 = (!431 !447 !448) !460 = (!431 !447 !448) !461 = (!431 !447 !448) -!462 = span !184 5316 5320 +!462 = span !184 5374 5378 !463 = (!431 !447 !448 !462) !464 = (!431 !447 !448) !465 = (!431 !447 !448) @@ -1409,15 +1409,15 @@ script { !476 = (!431 !447 !448) !477 = (!431 !447 !448) !478 = (!431 !447 !448) -!479 = span !184 5249 5332 +!479 = span !184 5307 5390 !480 = (!431 !447 !448 !479) !481 = (!431 !447 !448) -!482 = span !184 70839 70883 +!482 = span !184 70897 70941 !483 = (!431 !482) -!484 = span !184 70888 70894 +!484 = span !184 70946 70952 !485 = (!431 !484) -!486 = span !184 70888 70909 -!487 = fn_call_path_span !184 70895 70907 +!486 = span !184 70946 70967 +!487 = fn_call_path_span !184 70953 70965 !488 = (!431 !486 !487) !489 = span !184 573 577 !490 = (!431 !486 !487 !489) diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes_deprecated/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes_deprecated/stdout.snap index cc80fbe2efe..b88db32e087 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes_deprecated/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes_deprecated/stdout.snap @@ -164,22 +164,22 @@ warning: Struct field is deprecated ____ warning: Function is deprecated - --> test/src/e2e_vm_tests/test_programs/should_pass/language/attributes_deprecated/src/main..sw:5:15 - | + --> test/src/e2e_vm_tests/test_programs/should_pass/language/attributes_deprecated/src/main..sw:12:15 + | ... -5 | let _result = __contract_entry_deprecated_to_be_abi_method(); - | -------------------------------------------- Function "deprecated_to_be_abi_method" is deprecated. - | +12 | let _result = __contract_entry_deprecated_to_be_abi_method(); + | -------------------------------------------- Function "deprecated_to_be_abi_method" is deprecated. + | ____ warning: Function is deprecated - --> test/src/e2e_vm_tests/test_programs/should_pass/language/attributes_deprecated/src/main..sw:9:15 - | + --> test/src/e2e_vm_tests/test_programs/should_pass/language/attributes_deprecated/src/main..sw:18:15 + | ... -9 | let _result = __contract_entry_deprecated_abi_provided_method(); - | ----------------------------------------------- Function "deprecated_abi_provided_method" is deprecated. - | +18 | let _result = __contract_entry_deprecated_abi_provided_method(); + | ----------------------------------------------- Function "deprecated_abi_provided_method" is deprecated. + | ____ Compiled contract "attributes_deprecated" with 19 warnings. - Finished release [optimized + fuel] target(s) [872 B] in ??? + Finished release [optimized + fuel] target(s) [480 B] in ??? 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 5526fc5bfb3..876bf6a3e70 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 @@ -209,27 +209,27 @@ script { !1 = span !0 177 182 !2 = span !0 136 143 !3 = "sway-lib-std/src/codec.sw" -!4 = span !3 71152 71155 -!5 = span !3 71166 71169 -!6 = span !3 71176 71182 -!7 = span !3 71122 71455 -!8 = fn_name_span !3 71129 71148 +!4 = span !3 71210 71213 +!5 = span !3 71224 71227 +!6 = span !3 71234 71240 +!7 = span !3 71180 71513 +!8 = fn_name_span !3 71187 71206 !9 = inline "never" !10 = (!7 !8 !9) -!11 = span !3 71240 71274 -!12 = fn_call_path_span !3 71240 71264 +!11 = span !3 71298 71332 +!12 = fn_call_path_span !3 71298 71322 !13 = span !3 735 755 !14 = (!11 !12 !13) !15 = (!11 !12) !16 = (!11 !12 !13) -!17 = span !3 71223 71275 -!18 = span !3 71305 71311 -!19 = span !3 71291 71312 -!20 = fn_call_path_span !3 71291 71304 -!21 = span !3 115325 115346 -!22 = fn_call_path_span !3 115325 115338 -!23 = span !3 71904 71932 -!24 = fn_call_path_span !3 71911 71923 +!17 = span !3 71281 71333 +!18 = span !3 71363 71369 +!19 = span !3 71349 71370 +!20 = fn_call_path_span !3 71349 71362 +!21 = span !3 115383 115404 +!22 = fn_call_path_span !3 115383 115396 +!23 = span !3 71962 71990 +!24 = fn_call_path_span !3 71969 71981 !25 = span !3 625 637 !26 = (!19 !20 !21 !22 !23 !24 !25) !27 = (!19 !20 !21 !22 !23 !24) @@ -241,15 +241,15 @@ script { !33 = (!19 !20 !21 !22 !23 !24) !34 = span !3 2857 2896 !35 = (!19 !20 !21 !22 !23 !24 !34) -!36 = span !3 115324 115349 +!36 = span !3 115382 115407 !37 = (!19 !20 !36) !38 = (!19 !20 !36) !39 = (!19 !20 !36) -!40 = span !3 71280 71313 -!41 = span !3 71371 71375 -!42 = span !3 71361 71376 -!43 = span !3 71318 71453 -!44 = span !3 71426 71446 +!40 = span !3 71338 71371 +!41 = span !3 71429 71433 +!42 = span !3 71419 71434 +!43 = span !3 71376 71511 +!44 = span !3 71484 71504 !45 = "test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_dedup_decode/src/main..sw" !46 = span !45 0 127 !47 = fn_name_span !45 7 14 @@ -259,8 +259,8 @@ script { !51 = (!49 !50) !52 = span !45 91 113 !53 = fn_call_path_span !45 91 97 -!54 = span !3 70868 70881 -!55 = fn_call_path_span !3 70868 70879 +!54 = span !3 70926 70939 +!55 = fn_call_path_span !3 70926 70937 !56 = (!52 !53 !54 !55) !57 = (!52 !53 !54 !55) !58 = (!52 !53 !54 !55) @@ -272,10 +272,10 @@ script { !64 = span !3 191 254 !65 = (!52 !53 !54 !55 !64) !66 = (!52 !53 !54 !55) -!67 = span !3 70852 70882 -!68 = fn_call_path_span !3 70857 70867 +!67 = span !3 70910 70940 +!68 = fn_call_path_span !3 70915 70925 !69 = (!52 !53 !67 !68) -!70 = span !3 4768 4774 +!70 = span !3 4826 4832 !71 = (!52 !53 !67 !68 !70) !72 = span !3 87 114 !73 = (!52 !53 !67 !68 !72) @@ -299,15 +299,15 @@ script { !91 = (!52 !53 !67 !68) !92 = (!52 !53 !67 !68) !93 = (!52 !53 !67 !68) -!94 = span !3 4716 4799 +!94 = span !3 4774 4857 !95 = (!52 !53 !67 !68 !94) !96 = (!52 !53 !67 !68) -!97 = span !3 70839 70883 +!97 = span !3 70897 70941 !98 = (!52 !53 !97) -!99 = span !3 70888 70894 +!99 = span !3 70946 70952 !100 = (!52 !53 !99) -!101 = span !3 70888 70909 -!102 = fn_call_path_span !3 70895 70907 +!101 = span !3 70946 70967 +!102 = fn_call_path_span !3 70953 70965 !103 = (!52 !53 !101 !102) !104 = span !3 573 577 !105 = (!52 !53 !101 !102 !104) diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all/snapshot.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all/snapshot.toml new file mode 100644 index 00000000000..624d6b0cee8 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all/snapshot.toml @@ -0,0 +1,4 @@ +cmds = [ + "forc build --path {root}", + "forc build --path {root} --ir final --asm final | filter-fn {name} return_match_on_str_slice" +] \ No newline at end of file diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all/stdout.snap new file mode 100644 index 00000000000..11088732398 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all/stdout.snap @@ -0,0 +1,68 @@ +--- +source: test/src/snapshot/mod.rs +--- +> forc build --path test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all +exit status: 0 +output: + Building test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all + Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert) + Compiling script match_expressions_all (test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all) + Finished debug [unoptimized + fuel] target(s) [3.072 KB] in ??? + +> forc build --path test/src/e2e_vm_tests/test_programs/should_pass/language/match_expressions_all --ir final --asm final | filter-fn match_expressions_all return_match_on_str_slice + +pshl i15 ; save registers 16..40 +pshh i524288 ; save registers 40..64 +move $$locbase $sp ; save locals base register for function return_match_on_str_slice_8 +cfei i112 ; allocate 112 bytes for locals and 0 slots for call arguments +move $r0 $$arg0 ; save argument 0 (param) +move $r1 $$reta ; save return address +addi $r2 $$locbase i96 ; get offset to local __ptr slice +mcpi $r2 $$arg0 i16 ; copy memory +addr $r2 data_NonConfigurable_7; get __const_global's address in data section +sw $$locbase $r2 i0 ; store word +movi $r2 i5 ; initialize constant into register +sw $$locbase $r2 i1 ; store word +addi $r2 $$locbase i16 ; get offset to local __ptr slice +mcpi $r2 $$locbase i16 ; copy memory +addi $r2 $$locbase i16 ; get offset to local __ptr slice +move $$arg0 $r0 ; [call]: pass argument 0 +move $$arg1 $r2 ; [call]: pass argument 1 +jal $$reta $pc i40 ; [call]: call eq_9 +move $r0 $one ; move parameter from branch to block argument +jnzf $$retv $zero i31 +addi $r0 $$locbase i96 ; get offset to local __ptr slice +addr $r2 data_NonConfigurable_9; get __const_global0's address in data section +addi $r3 $$locbase i32 ; get offset to local __ptr { ptr, u64 } +sw $$locbase $r2 i4 ; store word +movi $r2 i7 ; initialize constant into register +sw $$locbase $r2 i5 ; store word +addi $r2 $$locbase i48 ; get offset to local __ptr slice +mcpi $r2 $r3 i16 ; copy memory +addi $r2 $$locbase i48 ; get offset to local __ptr slice +move $$arg0 $r0 ; [call]: pass argument 0 +move $$arg1 $r2 ; [call]: pass argument 1 +jal $$reta $pc i25 ; [call]: call eq_9 +movi $r0 i2 ; initialize constant into register +jnzf $$retv $zero i16 +addi $r0 $$locbase i96 ; get offset to local __ptr slice +addr $r2 data_NonConfigurable_10; get __const_global1's address in data section +addi $r3 $$locbase i64 ; get offset to local __ptr { ptr, u64 } +sw $$locbase $r2 i8 ; store word +movi $r2 i5 ; initialize constant into register +sw $$locbase $r2 i9 ; store word +addi $r2 $$locbase i80 ; get offset to local __ptr slice +mcpi $r2 $r3 i16 ; copy memory +addi $r2 $$locbase i80 ; get offset to local __ptr slice +move $$arg0 $r0 ; [call]: pass argument 0 +move $$arg1 $r2 ; [call]: pass argument 1 +jal $$reta $pc i10 ; [call]: call eq_9 +movi $r0 i3 ; initialize constant into register +jnzf $$retv $zero i1 +movi $r0 i1000 ; initialize constant into register +move $$retv $r0 ; set return value +cfsi i112 ; free 112 bytes for locals and 0 slots for extra call arguments +move $$reta $r1 ; restore return address +poph i524288 ; restore registers 40..64 +popl i15 ; restore registers 16..40 +jal $zero $$reta i0 ; return from call 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 bbd404dfe9d..ac6484c4825 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 @@ -8,26 +8,26 @@ 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 debug [unoptimized + fuel] target(s) [8.88 KB] in ??? + Finished debug [unoptimized + fuel] target(s) [8.584 KB] in ??? Running 12 tests, filtered 0 tests tested -- panicking_contract - test test_panicking_in_contract_self_impl ... ok (???, 11571 gas) - revert code: 8000000000000001 + test test_panicking_in_contract_self_impl ... ok (???, 11170 gas) + revert code: 828000000000000c ├─ panic message: panicking in contract self impl ├─ panicked: in ::panicking_in_contract_self_impl │ └─ at panicking_contract@1.2.3, src/main.sw:22:9 - test test_directly_panicking_method ... ok (???, 12853 gas) - revert code: 8080000000000002 + test test_directly_panicking_method ... ok (???, 12169 gas) + revert code: 820000000000000b ├─ panic message: Error C. ├─ panic value: C(true) ├─ panicked: in ::directly_panicking_method │ └─ at panicking_contract@1.2.3, src/main.sw:28:9 decoded log values: C(true), log rb: 5503570629422409978 - test test_nested_panic_inlined ... ok (???, 15735 gas) - revert code: 830000000540a013 + test test_nested_panic_inlined ... ok (???, 12903 gas) + revert code: 8000000000c01001 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) ├─ panicked: in panicking_lib::nested_panic_inlined @@ -38,8 +38,8 @@ C(true), log rb: 5503570629422409978 └─ at panicking_contract@1.2.3, src/main.sw:32:9 decoded log values: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978 - test test_nested_panic_inlined_same_revert_code ... ok (???, 15735 gas) - revert code: 830000000540a013 + test test_nested_panic_inlined_same_revert_code ... ok (???, 12903 gas) + revert code: 8000000000c01001 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) ├─ panicked: in panicking_lib::nested_panic_inlined @@ -50,8 +50,8 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString └─ at panicking_contract@1.2.3, src/main.sw:32:9 decoded log values: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978 - test test_nested_panic_non_inlined ... ok (???, 16289 gas) - revert code: 838000000680c818 + test test_nested_panic_non_inlined ... ok (???, 13013 gas) + revert code: 8180000002804808 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) ├─ panicked: in panicking_lib::nested_panic_non_inlined @@ -62,8 +62,8 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString └─ at panicking_contract@1.2.3, src/main.sw:40:9 decoded log values: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978 - test test_nested_panic_non_inlined_same_revert_code ... ok (???, 16289 gas) - revert code: 838000000680c818 + test test_nested_panic_non_inlined_same_revert_code ... ok (???, 13013 gas) + revert code: 8180000002804808 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) ├─ panicked: in panicking_lib::nested_panic_non_inlined @@ -74,8 +74,8 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_contract@1.2.3, src/main.sw:40:9 decoded log values: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978 - test test_generic_panic_with_unit ... ok (???, 14026 gas) - revert code: 828000000000800f + test test_generic_panic_with_unit ... ok (???, 11756 gas) + revert code: 8100000000003806 ├─ panic value: () ├─ panicked: in panicking_lib::generic_panic │ └─ at panicking_lib, src/lib.sw:74:5 @@ -83,8 +83,8 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_contract@1.2.3, src/main.sw:48:9 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_unit_same_revert_code ... ok (???, 14026 gas) - revert code: 828000000000800f + test test_generic_panic_with_unit_same_revert_code ... ok (???, 11756 gas) + revert code: 8100000000003806 ├─ panic value: () ├─ panicked: in panicking_lib::generic_panic │ └─ at panicking_lib, src/lib.sw:74:5 @@ -92,8 +92,8 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_contract@1.2.3, src/main.sw:48:9 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_str ... ok (???, 13958 gas) - revert code: 818000000000700d + test test_generic_panic_with_str ... ok (???, 11923 gas) + revert code: 8080000000002804 ├─ panic message: generic panic with string ├─ panicked: in panicking_lib::generic_panic │ └─ at panicking_lib, src/lib.sw:74:5 @@ -101,8 +101,8 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d └─ at panicking_contract@1.2.3, src/main.sw:56:9 decoded log values: AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 - test test_generic_panic_with_different_str_same_revert_code ... ok (???, 13190 gas) - revert code: 8180000000004007 + test test_generic_panic_with_different_str_same_revert_code ... ok (???, 12146 gas) + revert code: 808000000000d019 ├─ panic message: generic panic with different string ├─ panicked: in panicking_lib::generic_panic │ └─ at panicking_lib, src/lib.sw:74:5 @@ -110,8 +110,8 @@ AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218 └─ at panicking_contract@1.2.3, src/main.sw:60:9 decoded log values: AsciiString { data: "generic panic with different string" }, log rb: 10098701174489624218 - test test_generic_panic_with_error_type_enum ... ok (???, 13475 gas) - revert code: 8200000000005009 + test test_generic_panic_with_error_type_enum ... ok (???, 12064 gas) + revert code: 830000000000700d ├─ panic message: Error A. ├─ panic value: A ├─ panicked: in panicking_lib::generic_panic @@ -120,8 +120,8 @@ AsciiString { data: "generic panic with different string" }, log rb: 10098701174 └─ at panicking_contract@1.2.3, src/main.sw:64:9 decoded log values: A, log rb: 5503570629422409978 - test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 13867 gas) - revert code: 820000000000600b + test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 12331 gas) + revert code: 830000000000e01b ├─ panic message: Error B. ├─ panic value: B(42) ├─ panicked: in panicking_lib::generic_panic @@ -142,94 +142,94 @@ 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) [7.4 KB] in ??? + Finished release [optimized + fuel] target(s) [6.576 KB] in ??? Running 12 tests, filtered 0 tests tested -- panicking_contract - test test_panicking_in_contract_self_impl ... ok (???, 10831 gas) - revert code: 8000000000000000 + test test_panicking_in_contract_self_impl ... ok (???, 10462 gas) + revert code: 8280000000000000 ├─ panic message: panicking in contract self impl └─ panicked: in ::panicking_in_contract_self_impl └─ at panicking_contract@1.2.3, src/main.sw:22:9 - test test_directly_panicking_method ... ok (???, 11938 gas) - revert code: 8080000000000000 + test test_directly_panicking_method ... ok (???, 11382 gas) + revert code: 8200000000000000 ├─ panic message: Error C. ├─ panic value: C(true) └─ panicked: in ::directly_panicking_method └─ at panicking_contract@1.2.3, src/main.sw:28:9 decoded log values: C(true), log rb: 5503570629422409978 - test test_nested_panic_inlined ... ok (???, 14064 gas) - revert code: 8300000000000000 + test test_nested_panic_inlined ... ok (???, 12044 gas) + revert code: 8000000000000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) └─ panicked: in panicking_lib::nested_panic_inlined └─ at 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_inlined_same_revert_code ... ok (???, 14064 gas) - revert code: 8300000000000000 + test test_nested_panic_inlined_same_revert_code ... ok (???, 12044 gas) + revert code: 8000000000000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]) └─ panicked: in panicking_lib::nested_panic_inlined └─ at 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_non_inlined ... ok (???, 14454 gas) - revert code: 8380000000000000 + test test_nested_panic_non_inlined ... ok (???, 12100 gas) + revert code: 8180000000000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) └─ panicked: in panicking_lib::nested_panic_non_inlined └─ at 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_non_inlined_same_revert_code ... ok (???, 14454 gas) - revert code: 8380000000000000 + test test_nested_panic_non_inlined_same_revert_code ... ok (???, 12100 gas) + revert code: 8180000000000000 ├─ panic message: Error E. ├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]) └─ panicked: in panicking_lib::nested_panic_non_inlined └─ at 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_generic_panic_with_unit ... ok (???, 12702 gas) - revert code: 8280000000000000 + test test_generic_panic_with_unit ... ok (???, 11056 gas) + revert code: 8100000000000000 ├─ panic value: () └─ panicked: in panicking_lib::generic_panic └─ at panicking_lib, src/lib.sw:74:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_unit_same_revert_code ... ok (???, 12702 gas) - revert code: 8280000000000000 + test test_generic_panic_with_unit_same_revert_code ... ok (???, 11056 gas) + revert code: 8100000000000000 ├─ panic value: () └─ panicked: in panicking_lib::generic_panic └─ at panicking_lib, src/lib.sw:74:5 decoded log values: (), log rb: 3330666440490685604 - test test_generic_panic_with_str ... ok (???, 12720 gas) - revert code: 8180000000000000 + test test_generic_panic_with_str ... ok (???, 11245 gas) + revert code: 8080000000000000 ├─ panic message: generic panic with string └─ panicked: in panicking_lib::generic_panic └─ at 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 (???, 12186 gas) - revert code: 8180000000000000 + test test_generic_panic_with_different_str_same_revert_code ... ok (???, 11328 gas) + revert code: 8080000000000000 ├─ panic message: generic panic with different string └─ panicked: in panicking_lib::generic_panic └─ at 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 (???, 12364 gas) - revert code: 8200000000000000 + test test_generic_panic_with_error_type_enum ... ok (???, 11287 gas) + revert code: 8300000000000000 ├─ panic message: Error A. ├─ panic value: A └─ panicked: in panicking_lib::generic_panic └─ at 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 (???, 12642 gas) - revert code: 8200000000000000 + test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 11434 gas) + revert code: 8300000000000000 ├─ panic message: Error B. ├─ panic value: B(42) └─ panicked: in panicking_lib::generic_panic 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 570d34d72cd..9de52291359 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 = 0x9e0048a62c58414e5bbe689ad3fc0ef7f887bcf5668f01b5a60d513248d816c6; // AUTO-CONTRACT-ID ../../test_contracts/array_of_structs_contract --release +const CONTRACT_ID = 0x510e6c19520792268ca632dbc288092b1fe1e0ff1f9e1864e9a16054486644c8; // 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 457c8b52e62..6ef8dbdf5e9 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 @@ -9,12 +9,12 @@ use test_fuel_coin_abi::*; #[cfg(experimental_new_encoding = false)] const FUEL_COIN_CONTRACT_ID = 0xec2277ebe007ade87e3d797c3b1e070dcd542d5ef8f038b471f262ef9cebc87c; #[cfg(experimental_new_encoding = true)] -const FUEL_COIN_CONTRACT_ID = 0x17aa1f86a9e0a25c639b22341c4af4d31f2335c4244cab2c4022cf644efa7c46; // AUTO-CONTRACT-ID ../../test_contracts/test_fuel_coin_contract --release +const FUEL_COIN_CONTRACT_ID = 0x019af5b2fa0576ffd889b3843d08b9c1f352baf98031faabc098a0b6f1e5c46f; // AUTO-CONTRACT-ID ../../test_contracts/test_fuel_coin_contract --release #[cfg(experimental_new_encoding = false)] const BALANCE_CONTRACT_ID = 0xf6cd545152ac83225e8e7df2efb5c6fa6e37bc9b9e977b5ea8103d28668925df; #[cfg(experimental_new_encoding = true)] -const BALANCE_CONTRACT_ID = 0xa52577728c59f4b6bc6cb06901f748ed182f4bf55aba325de8a2dc8369e86c08; // AUTO-CONTRACT-ID ../../test_contracts/balance_test_contract --release +const BALANCE_CONTRACT_ID = 0xa30c5df660b642a857e4675dbab622031aca65a538eeca3961a7a5ff44a8dc07; // 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 6106221df19..cd6f084f77c 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 = 0xa52577728c59f4b6bc6cb06901f748ed182f4bf55aba325de8a2dc8369e86c08; // AUTO-CONTRACT-ID ../../test_contracts/balance_test_contract --release +const CONTRACT_ID = 0xa30c5df660b642a857e4675dbab622031aca65a538eeca3961a7a5ff44a8dc07; // 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 2d6101b12a5..6eb4cb53be9 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 = 0x73d7a99965a456f581c871ac5a55d7417797a08edc7edc043a66bed4f6352734; // AUTO-CONTRACT-ID ../../test_contracts/abi_with_tuples_contract --release +const CONTRACT_ID = 0xb17647b40915b3b1041040156882f95d7abe06818ebd4caf80baf9347c88d782; // 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 8a90da58329..59d87106133 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 = 0x841aa8d101ee9b06ff89b72bb5a2bdb46cd6981ba602619fda7424b8b7d47ada; // AUTO-CONTRACT-ID ../../test_contracts/basic_storage --release +const CONTRACT_ID = 0x04e4446fc4569e39c182de577ef794cf095a34119e1bb875fcca828cba85bb97; // 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 fae9126b8c8..5ffb41293e0 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 = 0xa0d3d4d39f1d9504b31696cfc28f42003c68f0743583084876d6ad914b42e063; // AUTO-CONTRACT-ID ../../test_contracts/contract_with_type_aliases --release +const CONTRACT_ID = 0xbbfb864b80edb429347a9dec482fb9fcd4a925e54ab3f78e90e51b61986cec3d; // 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 1658aeffe61..37a21dad59d 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 = 0x4ed3a95cb7daa9eac3ca954623d3fcb52c65011fc677c579e96662003605c2f8; // AUTO-CONTRACT-ID ../../test_contracts/increment_contract --release +const CONTRACT_ID = 0xbb33081bc6da28392260b076e53494190a1ff4426134921fd98b4371c2b00a3b; // 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 58521ebadfe..acddf36dffd 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 = 0x000c798c2f211f31bb2fb6c02fac49dcd461bab4b3c6ade2977ae71537f77406; // AUTO-CONTRACT-ID ../../test_contracts/storage_enum_contract --release +const CONTRACT_ID = 0x2f3c33ca9c000ae2e56515ce4796cb419393e7fd65da04adbb1d327aa7cc31fa; // 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 95803416473..fc125998751 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 = 0xa6cc9483ac189658ac9e50dea8a2fcaf288d8bc413b30636f8af302fbb1e9960; // AUTO-CONTRACT-ID ../../test_contracts/auth_testing_contract --release +const CONTRACT_ID = 0x8be75eacc0b96df2f77c12139a5f400c90757405cf3dda6a4efe98ec57469cc0; // 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 5224f74dafa..0970e26df21 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 = 0x3c7b414d62b63b1d63d762508b7524dffb89ed39ab49c87934e3b0bb202481a8; // AUTO-CONTRACT-ID ../../test_contracts/context_testing_contract --release +const CONTRACT_ID = 0x8b12252020214149904b24e98bd8c021f05f576d6e332eb473b08d776eecdf0e; // 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 d614d953460..f5c305540cb 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 = 0xd9d43e4d932376f6407d64131c127bfb97ed8039dcbfdb628875e9945eb566af; // AUTO-CONTRACT-ID ../../test_contracts/nested_struct_args_contract --release +const CONTRACT_ID = 0x95243bcc200f70abd7e9efa48d592c5d36ad3ebfc6be0d5a6c00f2f68c4bf79c; // 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 20760ddf675..b35d46e2ff1 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 = 0x4dc4ea62820f5db502781296582ac9e02132eec4452af5a994f92ad2185bb398; // AUTO-CONTRACT-ID ../../test_contracts/storage_access_contract --release +const CONTRACT_ID = 0x804f5350f8830794f6b7b470e3d9ad878be3afba9f326dbbf6623c4dd58e7fae; // AUTO-CONTRACT-ID ../../test_contracts/storage_access_contract --release fn main() -> bool { let caller = abi(StorageAccess, CONTRACT_ID); diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/stdout.snap index b0918dd0684..bcac2272e45 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/stdout.snap @@ -7,40 +7,40 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [35.272 KB] in ??? + Finished release [optimized + fuel] target(s) [32.624 KB] in ??? Running 29 tests, filtered 0 tests tested -- const_of_contract_call - test cost_of_in_bool ... ok (???, 14600 gas) - test cost_of_in_u8 ... ok (???, 18427 gas) - test cost_of_in_u16 ... ok (???, 17781 gas) - test cost_of_in_u32 ... ok (???, 18557 gas) - test cost_of_in_u64 ... ok (???, 18536 gas) - test cost_of_in_u256 ... ok (???, 18265 gas) - test cost_of_in_b256 ... ok (???, 14378 gas) - test cost_of_in_str_0 ... ok (???, 15302 gas) - test cost_of_in_str_1 ... ok (???, 15805 gas) - test cost_of_in_str_8 ... ok (???, 16528 gas) - test cost_of_in_str_16 ... ok (???, 15865 gas) - test cost_of_in_str_32 ... ok (???, 16205 gas) - test cost_of_in_array_0 ... FAILED (???, 12886 gas) - test cost_of_in_array_1 ... ok (???, 13775 gas) - test cost_of_in_array_8 ... ok (???, 18788 gas) - test cost_of_in_array_16 ... ok (???, 19141 gas) - test cost_of_in_array_32 ... ok (???, 25119 gas) - test cost_of_in_array_64 ... ok (???, 36762 gas) - test cost_of_in_tuple_0 ... ok (???, 16648 gas) - test cost_of_in_tuple_1 ... ok (???, 17622 gas) - test cost_of_in_tuple_2 ... ok (???, 18257 gas) - test cost_of_in_tuple_3 ... ok (???, 18849 gas) - test cost_of_in_tuple_4 ... ok (???, 19471 gas) - test in_struct_u64 ... ok (???, 16337 gas) - test in_struct_u64_u64 ... ok (???, 16791 gas) - test in_struct_u64_u64_u64 ... ok (???, 17241 gas) - test in_enum_u64 ... ok (???, 15575 gas) - test in_enum_u64_u64 ... ok (???, 15362 gas) - test in_enum_u64_u64_u64 ... ok (???, 15551 gas) + test cost_of_in_bool ... ok (???, 12523 gas) + test cost_of_in_u8 ... ok (???, 12488 gas) + test cost_of_in_u16 ... ok (???, 12606 gas) + test cost_of_in_u32 ... ok (???, 12863 gas) + test cost_of_in_u64 ... ok (???, 12530 gas) + test cost_of_in_u256 ... ok (???, 12639 gas) + test cost_of_in_b256 ... ok (???, 12623 gas) + test cost_of_in_str_0 ... ok (???, 12606 gas) + test cost_of_in_str_1 ... ok (???, 12787 gas) + test cost_of_in_str_8 ... ok (???, 12806 gas) + test cost_of_in_str_16 ... ok (???, 12803 gas) + test cost_of_in_str_32 ... ok (???, 12817 gas) + test cost_of_in_array_0 ... FAILED (???, 12305 gas) + test cost_of_in_array_1 ... ok (???, 12870 gas) + test cost_of_in_array_8 ... ok (???, 17012 gas) + test cost_of_in_array_16 ... ok (???, 18186 gas) + test cost_of_in_array_32 ... ok (???, 23872 gas) + test cost_of_in_array_64 ... ok (???, 35287 gas) + test cost_of_in_tuple_0 ... ok (???, 12057 gas) + test cost_of_in_tuple_1 ... ok (???, 12707 gas) + test cost_of_in_tuple_2 ... ok (???, 13022 gas) + test cost_of_in_tuple_3 ... ok (???, 13286 gas) + test cost_of_in_tuple_4 ... ok (???, 13584 gas) + test in_struct_u64 ... ok (???, 12726 gas) + test in_struct_u64_u64 ... ok (???, 13009 gas) + test in_struct_u64_u64_u64 ... ok (???, 13280 gas) + test in_enum_u64 ... ok (???, 13079 gas) + test in_enum_u64_u64 ... ok (???, 13090 gas) + test in_enum_u64_u64_u64 ... ok (???, 13106 gas) failures: test cost_of_in_array_0, "test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/src/main.sw":347 @@ -62,12 +62,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.768 KB] in ??? + Finished release [optimized + fuel] target(s) [1.48 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_array_0 ... FAILED (???, 10911 gas) + test isolated_cost_of_in_array_0 ... FAILED (???, 10602 gas) failures: test isolated_cost_of_in_array_0, "test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/src/main.sw":175 @@ -89,12 +89,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.944 KB] in ??? + Finished release [optimized + fuel] target(s) [1.656 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_array_1 ... ok (???, 11355 gas) + test isolated_cost_of_in_array_1 ... ok (???, 11046 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -109,12 +109,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.968 KB] in ??? + Finished release [optimized + fuel] target(s) [1.688 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_array_16 ... ok (???, 15174 gas) + test isolated_cost_of_in_array_16 ... ok (???, 14865 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -129,12 +129,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.968 KB] in ??? + Finished release [optimized + fuel] target(s) [1.688 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_array_32 ... ok (???, 19221 gas) + test isolated_cost_of_in_array_32 ... ok (???, 18911 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -149,12 +149,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [2.008 KB] in ??? + Finished release [optimized + fuel] target(s) [1.728 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_array_64 ... ok (???, 27369 gas) + test isolated_cost_of_in_array_64 ... ok (???, 27050 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -169,12 +169,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [2.104 KB] in ??? + Finished release [optimized + fuel] target(s) [1.816 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_array_8 ... ok (???, 14558 gas) + test isolated_cost_of_in_array_8 ... ok (???, 14248 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -189,12 +189,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.808 KB] in ??? + Finished release [optimized + fuel] target(s) [1.528 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_b256 ... ok (???, 11220 gas) + test isolated_cost_of_in_b256 ... ok (???, 10910 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -209,12 +209,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.696 KB] in ??? + Finished release [optimized + fuel] target(s) [1.408 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_bool ... ok (???, 11100 gas) + test isolated_cost_of_in_bool ... ok (???, 10791 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -229,12 +229,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [2.008 KB] in ??? + Finished release [optimized + fuel] target(s) [1.72 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_enum_u64 ... ok (???, 11617 gas) + test in_enum_u64 ... ok (???, 11308 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -249,12 +249,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [2.16 KB] in ??? + Finished release [optimized + fuel] target(s) [1.872 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_enum_u64_u64 ... ok (???, 11654 gas) + test in_enum_u64_u64 ... ok (???, 11344 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -269,12 +269,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [2.344 KB] in ??? + Finished release [optimized + fuel] target(s) [2.056 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_enum_u64_u64_u64 ... ok (???, 11675 gas) + test in_enum_u64_u64_u64 ... ok (???, 11366 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -289,12 +289,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.728 KB] in ??? + Finished release [optimized + fuel] target(s) [1.36 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_str_0 ... ok (???, 11250 gas) + test isolated_cost_of_in_str_0 ... ok (???, 10812 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -309,12 +309,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.928 KB] in ??? + Finished release [optimized + fuel] target(s) [1.592 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_str_1 ... ok (???, 11411 gas) + test isolated_cost_of_in_str_1 ... ok (???, 11006 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -329,12 +329,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.976 KB] in ??? + Finished release [optimized + fuel] target(s) [1.64 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_str_16 ... ok (???, 11425 gas) + test isolated_cost_of_in_str_16 ... ok (???, 11025 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -349,12 +349,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.992 KB] in ??? + Finished release [optimized + fuel] target(s) [1.656 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_str_32 ... ok (???, 11431 gas) + test isolated_cost_of_in_str_32 ... ok (???, 11030 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -369,12 +369,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.944 KB] in ??? + Finished release [optimized + fuel] target(s) [1.608 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_str_8 ... ok (???, 11421 gas) + test isolated_cost_of_in_str_8 ... ok (???, 11022 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -389,12 +389,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.824 KB] in ??? + Finished release [optimized + fuel] target(s) [1.536 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_struct_u64 ... ok (???, 11211 gas) + test in_struct_u64 ... ok (???, 10901 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -409,12 +409,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.96 KB] in ??? + Finished release [optimized + fuel] target(s) [1.68 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_struct_u64_u64 ... ok (???, 11561 gas) + test in_struct_u64_u64 ... ok (???, 11252 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -429,12 +429,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [2.032 KB] in ??? + Finished release [optimized + fuel] target(s) [1.744 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test in_struct_u64_u64_u64 ... ok (???, 11829 gas) + test in_struct_u64_u64_u64 ... ok (???, 11520 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -449,12 +449,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.12 KB] in ??? + Finished release [optimized + fuel] target(s) [832 B] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_tuple_0 ... ok (???, 10630 gas) + test isolated_cost_of_in_tuple_0 ... ok (???, 10321 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -469,12 +469,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.768 KB] in ??? + Finished release [optimized + fuel] target(s) [1.488 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_tuple_1 ... ok (???, 11172 gas) + test isolated_cost_of_in_tuple_1 ... ok (???, 10862 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -489,12 +489,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.944 KB] in ??? + Finished release [optimized + fuel] target(s) [1.664 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_tuple_2 ... ok (???, 11560 gas) + test isolated_cost_of_in_tuple_2 ... ok (???, 11251 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -509,12 +509,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [2.016 KB] in ??? + Finished release [optimized + fuel] target(s) [1.728 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_tuple_3 ... ok (???, 11829 gas) + test isolated_cost_of_in_tuple_3 ... ok (???, 11520 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -529,12 +529,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [2.08 KB] in ??? + Finished release [optimized + fuel] target(s) [1.8 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_tuple_4 ... ok (???, 12097 gas) + test isolated_cost_of_in_tuple_4 ... ok (???, 11787 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -549,12 +549,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.72 KB] in ??? + Finished release [optimized + fuel] target(s) [1.44 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_u16 ... ok (???, 11232 gas) + test isolated_cost_of_in_u16 ... ok (???, 10923 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -569,12 +569,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.808 KB] in ??? + Finished release [optimized + fuel] target(s) [1.528 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_u256 ... ok (???, 11220 gas) + test isolated_cost_of_in_u256 ... ok (???, 10910 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -589,12 +589,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.832 KB] in ??? + Finished release [optimized + fuel] target(s) [1.544 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_u32 ... ok (???, 11475 gas) + test isolated_cost_of_in_u32 ... ok (???, 11166 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -609,12 +609,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.624 KB] in ??? + Finished release [optimized + fuel] target(s) [1.344 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_u64 ... ok (???, 11059 gas) + test isolated_cost_of_in_u64 ... ok (???, 10749 gas) test result: OK. 1 passed; 0 failed; finished in ??? @@ -629,12 +629,12 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [1.664 KB] in ??? + Finished release [optimized + fuel] target(s) [1.384 KB] in ??? Running 1 test, filtered 0 tests tested -- const_of_contract_call - test isolated_cost_of_in_u8 ... ok (???, 11085 gas) + test isolated_cost_of_in_u8 ... ok (???, 10776 gas) test result: OK. 1 passed; 0 failed; finished in ???