diff --git a/language/bytecode-verifier/bytecode-verifier-tests/src/unit_tests/generic_ops_tests.rs b/language/bytecode-verifier/bytecode-verifier-tests/src/unit_tests/generic_ops_tests.rs index 92ed5b140f60..45c09e6b5da1 100644 --- a/language/bytecode-verifier/bytecode-verifier-tests/src/unit_tests/generic_ops_tests.rs +++ b/language/bytecode-verifier/bytecode-verifier-tests/src/unit_tests/generic_ops_tests.rs @@ -46,7 +46,10 @@ fn make_module() -> CompiledModuleMut { module: ModuleHandleIndex(0), name: IdentifierIndex(2), abilities: AbilitySet::PRIMITIVES, - type_parameters: vec![AbilitySet::PRIMITIVES], + type_parameters: vec![StructTypeParameter { + constraints: AbilitySet::PRIMITIVES, + is_phantom: false, + }], }, StructHandle { module: ModuleHandleIndex(0), @@ -58,7 +61,10 @@ fn make_module() -> CompiledModuleMut { module: ModuleHandleIndex(0), name: IdentifierIndex(4), abilities: AbilitySet::EMPTY | Ability::Key, - type_parameters: vec![AbilitySet::PRIMITIVES], + type_parameters: vec![StructTypeParameter { + constraints: AbilitySet::PRIMITIVES, + is_phantom: false, + }], }, ], struct_defs: vec![ diff --git a/language/bytecode-verifier/src/ability_field_requirements.rs b/language/bytecode-verifier/src/ability_field_requirements.rs index bb90697f3b42..b5b9fdcae2a8 100644 --- a/language/bytecode-verifier/src/ability_field_requirements.rs +++ b/language/bytecode-verifier/src/ability_field_requirements.rs @@ -37,7 +37,7 @@ fn verify_module_impl(module: &CompiledModule) -> PartialVMResult<()> { .map(|_| AbilitySet::ALL) .collect::>(); for field in fields { - let field_abilities = view.abilities(&field.signature.0, &type_parameter_abilities); + let field_abilities = view.abilities(&field.signature.0, &type_parameter_abilities)?; if !required_abilities.is_subset(field_abilities) { return Err(verification_error( StatusCode::FIELD_MISSING_TYPE_ABILITY, diff --git a/language/bytecode-verifier/src/dependencies.rs b/language/bytecode-verifier/src/dependencies.rs index 9c10a3b7d652..228de5443000 100644 --- a/language/bytecode-verifier/src/dependencies.rs +++ b/language/bytecode-verifier/src/dependencies.rs @@ -8,8 +8,8 @@ use move_binary_format::{ errors::{verification_error, Location, PartialVMError, PartialVMResult, VMResult}, file_format::{ AbilitySet, Bytecode, CodeOffset, CompiledModule, CompiledScript, FunctionDefinitionIndex, - FunctionHandleIndex, ModuleHandleIndex, SignatureToken, StructHandleIndex, TableIndex, - Visibility, + FunctionHandleIndex, ModuleHandleIndex, SignatureToken, StructHandleIndex, + StructTypeParameter, TableIndex, Visibility, }, IndexKind, }; @@ -210,7 +210,7 @@ fn verify_imported_structs(context: &Context) -> PartialVMResult<()> { Some(def_idx) => { let def_handle = owner_module.struct_handle_at(*def_idx); if !compatible_struct_abilities(struct_handle.abilities, def_handle.abilities) - || !compatible_type_parameters( + || !compatible_struct_type_parameters( &struct_handle.type_parameters, &def_handle.type_parameters, ) @@ -253,7 +253,7 @@ fn verify_imported_functions(context: &Context) -> PartialVMResult<()> { Some(def_idx) => { let def_handle = owner_module.function_handle_at(*def_idx); // compatible type parameter constraints - if !compatible_type_parameters( + if !compatible_fun_type_parameters( &function_handle.type_parameters, &def_handle.type_parameters, ) { @@ -330,10 +330,8 @@ fn compatible_struct_abilities( } // - The number of type parameters must be the same -// - For each type parameter, the local view must be a superset of (or equal to) the defined -// constraints. Conceptually, the local view can be more constrained than the defined one as the -// local context is only limiting usage, and cannot take advantage of the additional constraints. -fn compatible_type_parameters( +// - Each pair of parameters must satisfy [`compatible_type_parameter_constraints`] +fn compatible_fun_type_parameters( local_type_parameters_declaration: &[AbilitySet], defined_type_parameters: &[AbilitySet], ) -> bool { @@ -346,12 +344,57 @@ fn compatible_type_parameters( local_type_parameter_constraints_declaration, defined_type_parameter_constraints, )| { - (*defined_type_parameter_constraints) - .is_subset(*local_type_parameter_constraints_declaration) + compatible_type_parameter_constraints( + *local_type_parameter_constraints_declaration, + *defined_type_parameter_constraints, + ) }, ) } +// - The number of type parameters must be the same +// - Each pair of parameters must satisfy [`compatible_type_parameter_constraints`] and [`compatible_type_parameter_phantom_decl`] +fn compatible_struct_type_parameters( + local_type_parameters_declaration: &[StructTypeParameter], + defined_type_parameters: &[StructTypeParameter], +) -> bool { + local_type_parameters_declaration.len() == defined_type_parameters.len() + && local_type_parameters_declaration + .iter() + .zip(defined_type_parameters) + .all( + |(local_type_parameter_declaration, defined_type_parameter)| { + compatible_type_parameter_phantom_decl( + local_type_parameter_declaration, + defined_type_parameter, + ) && compatible_type_parameter_constraints( + local_type_parameter_declaration.constraints, + defined_type_parameter.constraints, + ) + }, + ) +} + +// The local view of a type parameter must be a superset of (or equal to) the defined +// constraints. Conceptually, the local view can be more constrained than the defined one as the +// local context is only limiting usage, and cannot take advantage of the additional constraints. +fn compatible_type_parameter_constraints( + local_type_parameter_constraints_declaration: AbilitySet, + defined_type_parameter_constraints: AbilitySet, +) -> bool { + defined_type_parameter_constraints.is_subset(local_type_parameter_constraints_declaration) +} + +// Adding phantom declarations relaxes the requirements for clients, thus, the local view may +// lack a phantom declaration present in the definition. +fn compatible_type_parameter_phantom_decl( + local_type_parameter_declaration: &StructTypeParameter, + defined_type_parameter: &StructTypeParameter, +) -> bool { + // local_type_parameter_declaration.is_phantom => defined_type_parameter.is_phantom + !local_type_parameter_declaration.is_phantom || defined_type_parameter.is_phantom +} + fn compare_cross_module_signatures( context: &Context, handle_sig: &[SignatureToken], diff --git a/language/bytecode-verifier/src/locals_safety/abstract_state.rs b/language/bytecode-verifier/src/locals_safety/abstract_state.rs index a3840e44d1b1..1d2c32535b5b 100644 --- a/language/bytecode-verifier/src/locals_safety/abstract_state.rs +++ b/language/bytecode-verifier/src/locals_safety/abstract_state.rs @@ -7,7 +7,7 @@ use crate::absint::{AbstractDomain, JoinResult}; use mirai_annotations::{checked_precondition, checked_verify}; use move_binary_format::{ binary_views::{BinaryIndexedView, FunctionView}, - errors::PartialVMError, + errors::{PartialVMError, PartialVMResult}, file_format::{AbilitySet, CodeOffset, FunctionDefinitionIndex, LocalIndex}, }; use move_core_types::vm_status::StatusCode; @@ -34,7 +34,10 @@ pub(crate) struct AbstractState { impl AbstractState { /// create a new abstract state - pub fn new(resolver: &BinaryIndexedView, function_view: &FunctionView) -> Self { + pub fn new( + resolver: &BinaryIndexedView, + function_view: &FunctionView, + ) -> PartialVMResult { let num_args = function_view.parameters().len(); let num_locals = num_args + function_view.locals().len(); let local_states = (0..num_locals) @@ -47,13 +50,13 @@ impl AbstractState { .iter() .chain(function_view.locals().0.iter()) .map(|st| resolver.abilities(st, &function_view.type_parameters())) - .collect(); + .collect::>>()?; - Self { + Ok(Self { current_function: function_view.index(), local_states, all_local_abilities, - } + }) } pub fn local_abilities(&self, idx: LocalIndex) -> AbilitySet { diff --git a/language/bytecode-verifier/src/locals_safety/mod.rs b/language/bytecode-verifier/src/locals_safety/mod.rs index 1e6bca05787b..2a3a0af778c5 100644 --- a/language/bytecode-verifier/src/locals_safety/mod.rs +++ b/language/bytecode-verifier/src/locals_safety/mod.rs @@ -22,7 +22,7 @@ pub(crate) fn verify<'a>( resolver: &BinaryIndexedView, function_view: &'a FunctionView<'a>, ) -> PartialVMResult<()> { - let initial_state = AbstractState::new(resolver, function_view); + let initial_state = AbstractState::new(resolver, function_view)?; let inv_map = LocalsSafetyAnalysis().analyze_function(initial_state, &function_view); // Report all the join failures for (_block_id, BlockInvariant { post, .. }) in inv_map { diff --git a/language/bytecode-verifier/src/signature.rs b/language/bytecode-verifier/src/signature.rs index 2b9ec226c1b5..160ab08ab251 100644 --- a/language/bytecode-verifier/src/signature.rs +++ b/language/bytecode-verifier/src/signature.rs @@ -11,7 +11,7 @@ use move_binary_format::{ file_format::{ AbilitySet, Bytecode, CodeUnit, CompiledModule, CompiledScript, FunctionDefinition, FunctionHandle, Signature, SignatureIndex, SignatureToken, StructDefinition, - StructFieldInformation, TableIndex, + StructFieldInformation, StructTypeParameter, TableIndex, }, IndexKind, }; @@ -93,8 +93,14 @@ impl<'a> SignatureChecker<'a> { for (field_offset, field_def) in fields.iter().enumerate() { self.check_signature_token(&field_def.signature.0) .map_err(|err| err_handler(err, field_offset))?; - self.check_type_instantiation( + let type_param_constraints: Vec<_> = + struct_handle.type_param_constraints().collect(); + self.check_type_instantiation(&field_def.signature.0, &type_param_constraints) + .map_err(|err| err_handler(err, field_offset))?; + + self.check_phantom_params( &field_def.signature.0, + false, &struct_handle.type_parameters, ) .map_err(|err| err_handler(err, field_offset))?; @@ -135,7 +141,7 @@ impl<'a> SignatureChecker<'a> { self.check_signature_tokens(type_arguments)?; self.check_generic_instance( type_arguments, - &func_handle.type_parameters, + func_handle.type_parameters.iter().copied(), type_parameters, ) } @@ -153,7 +159,7 @@ impl<'a> SignatureChecker<'a> { self.check_signature_tokens(type_arguments)?; self.check_generic_instance( type_arguments, - &struct_handle.type_parameters, + struct_handle.type_param_constraints(), type_parameters, ) } @@ -166,7 +172,7 @@ impl<'a> SignatureChecker<'a> { self.check_signature_tokens(type_arguments)?; self.check_generic_instance( type_arguments, - &struct_handle.type_parameters, + struct_handle.type_param_constraints(), type_parameters, ) } @@ -188,6 +194,49 @@ impl<'a> SignatureChecker<'a> { Ok(()) } + /// Checks that phantom type parameters are only used in phantom position. + fn check_phantom_params( + &self, + ty: &SignatureToken, + is_phantom_pos: bool, + type_parameters: &[StructTypeParameter], + ) -> PartialVMResult<()> { + match ty { + SignatureToken::Vector(ty) => self.check_phantom_params(ty, false, type_parameters)?, + SignatureToken::StructInstantiation(idx, type_arguments) => { + let sh = self.resolver.struct_handle_at(*idx); + for (i, ty) in type_arguments.iter().enumerate() { + self.check_phantom_params( + ty, + sh.type_parameters[i].is_phantom, + type_parameters, + )?; + } + } + SignatureToken::TypeParameter(idx) => { + if type_parameters[*idx as usize].is_phantom && !is_phantom_pos { + return Err(PartialVMError::new( + StatusCode::INVALID_PHANTOM_TYPE_PARAM_POSITION, + ) + .with_message( + "phantom type parameter cannot be used in non-phantom position".to_string(), + )); + } + } + + SignatureToken::Struct(_) + | SignatureToken::Reference(_) + | SignatureToken::MutableReference(_) + | SignatureToken::Bool + | SignatureToken::U8 + | SignatureToken::U64 + | SignatureToken::U128 + | SignatureToken::Address + | SignatureToken::Signer => {} + } + Ok(()) + } + /// Checks if the given type is well defined in the given context. /// References are only permitted at the top level. fn check_signature(&self, idx: SignatureIndex) -> PartialVMResult<()> { @@ -251,7 +300,11 @@ impl<'a> SignatureChecker<'a> { // i.e. it cannot be checked unless we are inside some module member. The only case // where that happens is when checking the signature pool itself let sh = self.resolver.struct_handle_at(*idx); - self.check_generic_instance(type_arguments, &sh.type_parameters, type_parameters) + self.check_generic_instance( + type_arguments, + sh.type_param_constraints(), + type_parameters, + ) } _ => Ok(()), } @@ -261,13 +314,11 @@ impl<'a> SignatureChecker<'a> { fn check_generic_instance( &self, type_arguments: &[SignatureToken], - constraints: &[AbilitySet], + constraints: impl IntoIterator, global_abilities: &[AbilitySet], ) -> PartialVMResult<()> { - let abilities = type_arguments - .iter() - .map(|ty| self.resolver.abilities(ty, global_abilities)); - for ((constraint, given), ty) in constraints.iter().zip(abilities).zip(type_arguments) { + for (constraint, ty) in constraints.into_iter().zip(type_arguments) { + let given = self.resolver.abilities(ty, global_abilities)?; if !constraint.is_subset(given) { return Err(PartialVMError::new(StatusCode::CONSTRAINT_NOT_SATISFIED) .with_message(format!( diff --git a/language/bytecode-verifier/src/type_safety.rs b/language/bytecode-verifier/src/type_safety.rs index 6e68b37e0576..086c4b5fdc01 100644 --- a/language/bytecode-verifier/src/type_safety.rs +++ b/language/bytecode-verifier/src/type_safety.rs @@ -64,7 +64,7 @@ impl<'a> TypeSafetyChecker<'a> { self.locals.local_at(i) } - fn abilities(&self, t: &SignatureToken) -> AbilitySet { + fn abilities(&self, t: &SignatureToken) -> PartialVMResult { self.resolver .abilities(&t, self.function_view.type_parameters()) } @@ -176,7 +176,7 @@ fn borrow_global( let struct_def = verifier.resolver.struct_def_at(idx)?; let struct_type = materialize_type(struct_def.struct_handle, type_args); - if !verifier.abilities(&struct_type).has_key() { + if !verifier.abilities(&struct_type)?.has_key() { return Err(verifier.error(StatusCode::BORROWGLOBAL_WITHOUT_KEY_ABILITY, offset)); } @@ -277,7 +277,7 @@ fn exists( type_args: &Signature, ) -> PartialVMResult<()> { let struct_type = materialize_type(struct_def.struct_handle, type_args); - if !verifier.abilities(&struct_type).has_key() { + if !verifier.abilities(&struct_type)?.has_key() { return Err(verifier.error( StatusCode::EXISTS_WITHOUT_KEY_ABILITY_OR_BAD_ARGUMENT, offset, @@ -304,7 +304,7 @@ fn move_from( type_args: &Signature, ) -> PartialVMResult<()> { let struct_type = materialize_type(struct_def.struct_handle, type_args); - if !verifier.abilities(&struct_type).has_key() { + if !verifier.abilities(&struct_type)?.has_key() { return Err(verifier.error(StatusCode::MOVEFROM_WITHOUT_KEY_ABILITY, offset)); } @@ -325,7 +325,7 @@ fn move_to( type_args: &Signature, ) -> PartialVMResult<()> { let struct_type = materialize_type(struct_def.struct_handle, type_args); - if !verifier.abilities(&struct_type).has_key() { + if !verifier.abilities(&struct_type)?.has_key() { return Err(verifier.error(StatusCode::MOVETO_WITHOUT_KEY_ABILITY, offset)); } @@ -355,7 +355,7 @@ fn verify_instr( let abilities = verifier .resolver .abilities(&operand, verifier.function_view.type_parameters()); - if !abilities.has_drop() { + if !abilities?.has_drop() { return Err(verifier.error(StatusCode::POP_WITHOUT_DROP_ABILITY, offset)); } } @@ -458,7 +458,7 @@ fn verify_instr( let local_signature = verifier.local_at(*idx).clone(); if !verifier .resolver - .abilities(&local_signature, verifier.function_view.type_parameters()) + .abilities(&local_signature, verifier.function_view.type_parameters())? .has_copy() { return Err(verifier.error(StatusCode::COPYLOC_WITHOUT_COPY_ABILITY, offset)); @@ -515,7 +515,7 @@ fn verify_instr( let operand = verifier.stack.pop().unwrap(); match operand { ST::Reference(inner) | ST::MutableReference(inner) => { - if !verifier.abilities(&inner).has_copy() { + if !verifier.abilities(&inner)?.has_copy() { return Err( verifier.error(StatusCode::READREF_WITHOUT_COPY_ABILITY, offset) ); @@ -537,7 +537,7 @@ fn verify_instr( ) } }; - if !verifier.abilities(&ref_inner_signature).has_drop() { + if !verifier.abilities(&ref_inner_signature)?.has_drop() { return Err(verifier.error(StatusCode::WRITEREF_WITHOUT_DROP_ABILITY, offset)); } @@ -617,7 +617,7 @@ fn verify_instr( Bytecode::Eq | Bytecode::Neq => { let operand1 = verifier.stack.pop().unwrap(); let operand2 = verifier.stack.pop().unwrap(); - if verifier.abilities(&operand1).has_drop() && operand1 == operand2 { + if verifier.abilities(&operand1)?.has_drop() && operand1 == operand2 { verifier.stack.push(ST::Bool); } else { return Err(verifier.error(StatusCode::EQUALITY_OP_TYPE_MISMATCH_ERROR, offset)); diff --git a/language/compiler/ir-to-bytecode/src/compiler.rs b/language/compiler/ir-to-bytecode/src/compiler.rs index 7f17bdbdd8b4..8e8e9decde9d 100644 --- a/language/compiler/ir-to-bytecode/src/compiler.rs +++ b/language/compiler/ir-to-bytecode/src/compiler.rs @@ -13,8 +13,8 @@ use move_binary_format::{ Ability, AbilitySet, Bytecode, CodeOffset, CodeUnit, CompiledModule, CompiledModuleMut, CompiledScript, CompiledScriptMut, Constant, FieldDefinition, FunctionDefinition, FunctionSignature, ModuleHandle, Signature, SignatureToken, StructDefinition, - StructDefinitionIndex, StructFieldInformation, StructHandleIndex, TableIndex, - TypeParameterIndex, TypeSignature, Visibility, + StructDefinitionIndex, StructFieldInformation, StructHandleIndex, StructTypeParameter, + TableIndex, TypeParameterIndex, TypeSignature, Visibility, }, file_format_common::VERSION_MAX, }; @@ -745,8 +745,14 @@ fn make_type_argument_subst( Ok(subst) } -fn type_parameter_kinds(ast_tys: &[(TypeVar, BTreeSet)]) -> Vec { - ast_tys.iter().map(|(_, abs)| abilities(abs)).collect() +fn type_parameter_kinds(ast_tys: &[(TypeVar, BTreeSet)]) -> Vec { + ast_tys + .iter() + .map(|(_, abs)| StructTypeParameter { + constraints: abilities(abs), + is_phantom: false, + }) + .collect() } fn abilities(abilities: &BTreeSet) -> AbilitySet { diff --git a/language/compiler/ir-to-bytecode/src/context.rs b/language/compiler/ir-to-bytecode/src/context.rs index 6bbf5333d867..c204c02d1d4b 100644 --- a/language/compiler/ir-to-bytecode/src/context.rs +++ b/language/compiler/ir-to-bytecode/src/context.rs @@ -11,7 +11,7 @@ use move_binary_format::{ FunctionHandle, FunctionHandleIndex, FunctionInstantiation, FunctionInstantiationIndex, FunctionSignature, IdentifierIndex, ModuleHandle, ModuleHandleIndex, Signature, SignatureIndex, SignatureToken, StructDefInstantiation, StructDefInstantiationIndex, - StructDefinitionIndex, StructHandle, StructHandleIndex, TableIndex, + StructDefinitionIndex, StructHandle, StructHandleIndex, StructTypeParameter, TableIndex, }, CompiledModule, }; @@ -591,7 +591,7 @@ impl<'a> Context<'a> { &mut self, sname: QualifiedStructIdent, abilities: AbilitySet, - type_parameters: Vec, + type_parameters: Vec, ) -> Result { self.declare_struct_handle_index_with_abilities(sname, abilities, type_parameters) } @@ -600,7 +600,7 @@ impl<'a> Context<'a> { &mut self, sname: QualifiedStructIdent, abilities: AbilitySet, - type_parameters: Vec, + type_parameters: Vec, ) -> Result { let module = self.module_handle_index(&sname.module)?; let name = self.identifier_index(sname.name.as_inner())?; @@ -722,7 +722,7 @@ impl<'a> Context<'a> { fn dep_struct_handle( &mut self, s: &QualifiedStructIdent, - ) -> Result<(AbilitySet, Vec)> { + ) -> Result<(AbilitySet, Vec)> { if s.module.as_inner() == ModuleName::self_name() { bail!("Unbound struct {}", s) } diff --git a/language/diem-framework/releases/artifacts/current/modules/AccountAdministrationScripts.mv b/language/diem-framework/releases/artifacts/current/modules/AccountAdministrationScripts.mv index 05d4dde980b1..389f6a87a34c 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/AccountAdministrationScripts.mv and b/language/diem-framework/releases/artifacts/current/modules/AccountAdministrationScripts.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/AccountCreationScripts.mv b/language/diem-framework/releases/artifacts/current/modules/AccountCreationScripts.mv index 33ea76678444..2dc0e1696206 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/AccountCreationScripts.mv and b/language/diem-framework/releases/artifacts/current/modules/AccountCreationScripts.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/AccountFreezing.mv b/language/diem-framework/releases/artifacts/current/modules/AccountFreezing.mv index 0409c251fb3b..0c2dbc23fa01 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/AccountFreezing.mv and b/language/diem-framework/releases/artifacts/current/modules/AccountFreezing.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/AccountLimits.mv b/language/diem-framework/releases/artifacts/current/modules/AccountLimits.mv index dd4e1c51645b..33f39a2e86ba 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/AccountLimits.mv and b/language/diem-framework/releases/artifacts/current/modules/AccountLimits.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/Authenticator.mv b/language/diem-framework/releases/artifacts/current/modules/Authenticator.mv index 14a53b062084..ab4d4b7a2808 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/Authenticator.mv and b/language/diem-framework/releases/artifacts/current/modules/Authenticator.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/BCS.mv b/language/diem-framework/releases/artifacts/current/modules/BCS.mv index 30d44e66b2f9..2db5ad53a1fb 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/BCS.mv and b/language/diem-framework/releases/artifacts/current/modules/BCS.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/ChainId.mv b/language/diem-framework/releases/artifacts/current/modules/ChainId.mv index 73de198ea90b..05dc5d9606f7 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/ChainId.mv and b/language/diem-framework/releases/artifacts/current/modules/ChainId.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/CoreAddresses.mv b/language/diem-framework/releases/artifacts/current/modules/CoreAddresses.mv index 41e5152268ae..d8173cb22a97 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/CoreAddresses.mv and b/language/diem-framework/releases/artifacts/current/modules/CoreAddresses.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/DesignatedDealer.mv b/language/diem-framework/releases/artifacts/current/modules/DesignatedDealer.mv index 46d6621dfd04..4d9accea7624 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/DesignatedDealer.mv and b/language/diem-framework/releases/artifacts/current/modules/DesignatedDealer.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/Diem.mv b/language/diem-framework/releases/artifacts/current/modules/Diem.mv index 0e2030d33f8b..912dccbd286f 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/Diem.mv and b/language/diem-framework/releases/artifacts/current/modules/Diem.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/DiemAccount.mv b/language/diem-framework/releases/artifacts/current/modules/DiemAccount.mv index 14bb6b2cce32..0285f727edc5 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/DiemAccount.mv and b/language/diem-framework/releases/artifacts/current/modules/DiemAccount.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/DiemBlock.mv b/language/diem-framework/releases/artifacts/current/modules/DiemBlock.mv index 80a271ae1617..06de565c60cd 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/DiemBlock.mv and b/language/diem-framework/releases/artifacts/current/modules/DiemBlock.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/DiemConfig.mv b/language/diem-framework/releases/artifacts/current/modules/DiemConfig.mv index 760cba4f3c60..d6c8b81a6842 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/DiemConfig.mv and b/language/diem-framework/releases/artifacts/current/modules/DiemConfig.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/DiemConsensusConfig.mv b/language/diem-framework/releases/artifacts/current/modules/DiemConsensusConfig.mv index 494070b2f2a2..69f598a788c6 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/DiemConsensusConfig.mv and b/language/diem-framework/releases/artifacts/current/modules/DiemConsensusConfig.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/DiemId.mv b/language/diem-framework/releases/artifacts/current/modules/DiemId.mv index ccc09f733bd4..e3f892eda19d 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/DiemId.mv and b/language/diem-framework/releases/artifacts/current/modules/DiemId.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/DiemSystem.mv b/language/diem-framework/releases/artifacts/current/modules/DiemSystem.mv index 2d329e3d2036..4f1c750fbfe8 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/DiemSystem.mv and b/language/diem-framework/releases/artifacts/current/modules/DiemSystem.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/DiemTimestamp.mv b/language/diem-framework/releases/artifacts/current/modules/DiemTimestamp.mv index 69c59ba8362e..c46b45f739c1 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/DiemTimestamp.mv and b/language/diem-framework/releases/artifacts/current/modules/DiemTimestamp.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/DiemTransactionPublishingOption.mv b/language/diem-framework/releases/artifacts/current/modules/DiemTransactionPublishingOption.mv index 89458a077f5c..0aa23b4517c6 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/DiemTransactionPublishingOption.mv and b/language/diem-framework/releases/artifacts/current/modules/DiemTransactionPublishingOption.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/DiemVMConfig.mv b/language/diem-framework/releases/artifacts/current/modules/DiemVMConfig.mv index e255b4c343bf..26fc2fae0839 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/DiemVMConfig.mv and b/language/diem-framework/releases/artifacts/current/modules/DiemVMConfig.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/DiemVersion.mv b/language/diem-framework/releases/artifacts/current/modules/DiemVersion.mv index f7cbecab76b5..9872e656febb 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/DiemVersion.mv and b/language/diem-framework/releases/artifacts/current/modules/DiemVersion.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/DualAttestation.mv b/language/diem-framework/releases/artifacts/current/modules/DualAttestation.mv index 4ba9861c0eaa..f8ba54718639 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/DualAttestation.mv and b/language/diem-framework/releases/artifacts/current/modules/DualAttestation.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/Errors.mv b/language/diem-framework/releases/artifacts/current/modules/Errors.mv index e02bef956f7a..9e1b77c53d70 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/Errors.mv and b/language/diem-framework/releases/artifacts/current/modules/Errors.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/Event.mv b/language/diem-framework/releases/artifacts/current/modules/Event.mv index c91d17dc7803..c5d81ffd6057 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/Event.mv and b/language/diem-framework/releases/artifacts/current/modules/Event.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/FixedPoint32.mv b/language/diem-framework/releases/artifacts/current/modules/FixedPoint32.mv index 5f7e4012c81c..da2013b20645 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/FixedPoint32.mv and b/language/diem-framework/releases/artifacts/current/modules/FixedPoint32.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/Genesis.mv b/language/diem-framework/releases/artifacts/current/modules/Genesis.mv index dd5ed1c098c7..5a24d5932887 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/Genesis.mv and b/language/diem-framework/releases/artifacts/current/modules/Genesis.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/Hash.mv b/language/diem-framework/releases/artifacts/current/modules/Hash.mv index cd88b742d23b..795b66608573 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/Hash.mv and b/language/diem-framework/releases/artifacts/current/modules/Hash.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/Option.mv b/language/diem-framework/releases/artifacts/current/modules/Option.mv index a0af5a30a686..fadd75c3a0c8 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/Option.mv and b/language/diem-framework/releases/artifacts/current/modules/Option.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/PaymentScripts.mv b/language/diem-framework/releases/artifacts/current/modules/PaymentScripts.mv index 3359e7bd4048..5268b3d0608a 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/PaymentScripts.mv and b/language/diem-framework/releases/artifacts/current/modules/PaymentScripts.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/RecoveryAddress.mv b/language/diem-framework/releases/artifacts/current/modules/RecoveryAddress.mv index 8dc08dca32ab..290efecf32d9 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/RecoveryAddress.mv and b/language/diem-framework/releases/artifacts/current/modules/RecoveryAddress.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/RegisteredCurrencies.mv b/language/diem-framework/releases/artifacts/current/modules/RegisteredCurrencies.mv index a0c46d007ca0..1ccd7d68a066 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/RegisteredCurrencies.mv and b/language/diem-framework/releases/artifacts/current/modules/RegisteredCurrencies.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/Roles.mv b/language/diem-framework/releases/artifacts/current/modules/Roles.mv index 02cea8b0b53d..53ba95c46e71 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/Roles.mv and b/language/diem-framework/releases/artifacts/current/modules/Roles.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/SharedEd25519PublicKey.mv b/language/diem-framework/releases/artifacts/current/modules/SharedEd25519PublicKey.mv index b81928fba715..57e17ced9102 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/SharedEd25519PublicKey.mv and b/language/diem-framework/releases/artifacts/current/modules/SharedEd25519PublicKey.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/Signature.mv b/language/diem-framework/releases/artifacts/current/modules/Signature.mv index 1fd438055f77..d6bfe119b223 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/Signature.mv and b/language/diem-framework/releases/artifacts/current/modules/Signature.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/Signer.mv b/language/diem-framework/releases/artifacts/current/modules/Signer.mv index 67a7ab24b60f..9a07cce700c7 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/Signer.mv and b/language/diem-framework/releases/artifacts/current/modules/Signer.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/SlidingNonce.mv b/language/diem-framework/releases/artifacts/current/modules/SlidingNonce.mv index 2f5e7172cbb2..91535fa5f18e 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/SlidingNonce.mv and b/language/diem-framework/releases/artifacts/current/modules/SlidingNonce.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/SystemAdministrationScripts.mv b/language/diem-framework/releases/artifacts/current/modules/SystemAdministrationScripts.mv index 5e3fbcd555e5..cde17f770cee 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/SystemAdministrationScripts.mv and b/language/diem-framework/releases/artifacts/current/modules/SystemAdministrationScripts.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/TransactionFee.mv b/language/diem-framework/releases/artifacts/current/modules/TransactionFee.mv index 1da1dfcd2ae8..d9a9dfd7b6ac 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/TransactionFee.mv and b/language/diem-framework/releases/artifacts/current/modules/TransactionFee.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/TreasuryComplianceScripts.mv b/language/diem-framework/releases/artifacts/current/modules/TreasuryComplianceScripts.mv index e852d94b48ff..09b548babbeb 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/TreasuryComplianceScripts.mv and b/language/diem-framework/releases/artifacts/current/modules/TreasuryComplianceScripts.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/VASP.mv b/language/diem-framework/releases/artifacts/current/modules/VASP.mv index 4b75165c658d..e37957e31b0a 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/VASP.mv and b/language/diem-framework/releases/artifacts/current/modules/VASP.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/ValidatorAdministrationScripts.mv b/language/diem-framework/releases/artifacts/current/modules/ValidatorAdministrationScripts.mv index 8f5d9fbf6356..047bee040135 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/ValidatorAdministrationScripts.mv and b/language/diem-framework/releases/artifacts/current/modules/ValidatorAdministrationScripts.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/ValidatorConfig.mv b/language/diem-framework/releases/artifacts/current/modules/ValidatorConfig.mv index c9c667e5c680..ac210444725a 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/ValidatorConfig.mv and b/language/diem-framework/releases/artifacts/current/modules/ValidatorConfig.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/ValidatorOperatorConfig.mv b/language/diem-framework/releases/artifacts/current/modules/ValidatorOperatorConfig.mv index 11adda9f59ec..1876bee8f483 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/ValidatorOperatorConfig.mv and b/language/diem-framework/releases/artifacts/current/modules/ValidatorOperatorConfig.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/Vector.mv b/language/diem-framework/releases/artifacts/current/modules/Vector.mv index e52ea31b65c8..a929332dfaea 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/Vector.mv and b/language/diem-framework/releases/artifacts/current/modules/Vector.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/XDX.mv b/language/diem-framework/releases/artifacts/current/modules/XDX.mv index ebc574edc080..9baa6591e447 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/XDX.mv and b/language/diem-framework/releases/artifacts/current/modules/XDX.mv differ diff --git a/language/diem-framework/releases/artifacts/current/modules/XUS.mv b/language/diem-framework/releases/artifacts/current/modules/XUS.mv index f0b19c19ee0d..e886411d4159 100644 Binary files a/language/diem-framework/releases/artifacts/current/modules/XUS.mv and b/language/diem-framework/releases/artifacts/current/modules/XUS.mv differ diff --git a/language/move-binary-format/src/binary_views.rs b/language/move-binary-format/src/binary_views.rs index ffd811703eda..8e934bbf9b80 100644 --- a/language/move-binary-format/src/binary_views.rs +++ b/language/move-binary-format/src/binary_views.rs @@ -248,29 +248,40 @@ impl<'a> BinaryIndexedView<'a> { // Return the `AbilitySet` of a `SignatureToken` given a context. // A `TypeParameter` has the abilities of its `constraints`. // `StructInstantiation` abilities are predicated on the particular instantiation - pub fn abilities(&self, ty: &SignatureToken, constraints: &[AbilitySet]) -> AbilitySet { + pub fn abilities( + &self, + ty: &SignatureToken, + constraints: &[AbilitySet], + ) -> PartialVMResult { use SignatureToken::*; match ty { - Bool | U8 | U64 | U128 | Address => AbilitySet::PRIMITIVES, + Bool | U8 | U64 | U128 | Address => Ok(AbilitySet::PRIMITIVES), - Reference(_) | MutableReference(_) => AbilitySet::REFERENCES, - Signer => AbilitySet::SIGNER, - TypeParameter(idx) => constraints[*idx as usize], + Reference(_) | MutableReference(_) => Ok(AbilitySet::REFERENCES), + Signer => Ok(AbilitySet::SIGNER), + TypeParameter(idx) => Ok(constraints[*idx as usize]), Vector(ty) => AbilitySet::polymorphic_abilities( AbilitySet::VECTOR, - vec![self.abilities(ty, constraints)].into_iter(), + vec![false], + vec![self.abilities(ty, constraints)?], ), Struct(idx) => { let sh = self.struct_handle_at(*idx); - sh.abilities + Ok(sh.abilities) } StructInstantiation(idx, type_args) => { let sh = self.struct_handle_at(*idx); let declared_abilities = sh.abilities; - let type_argument_abilities = - type_args.iter().map(|ty| self.abilities(ty, constraints)); - AbilitySet::polymorphic_abilities(declared_abilities, type_argument_abilities) + let type_arguments = type_args + .iter() + .map(|arg| self.abilities(arg, constraints)) + .collect::>>()?; + AbilitySet::polymorphic_abilities( + declared_abilities, + sh.type_parameters.iter().map(|param| param.is_phantom), + type_arguments, + ) } } } diff --git a/language/move-binary-format/src/compatibility.rs b/language/move-binary-format/src/compatibility.rs index d1cc299807f8..d12b5a2d4279 100644 --- a/language/move-binary-format/src/compatibility.rs +++ b/language/move-binary-format/src/compatibility.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::{ - file_format::{AbilitySet, Visibility}, + file_format::{AbilitySet, StructTypeParameter, Visibility}, normalized::Module, }; use std::collections::BTreeSet; @@ -59,7 +59,7 @@ impl Compatibility { }; if !struct_abilities_compatibile(old_struct.abilities, new_struct.abilities) - || !type_parameters_compatibile( + || !struct_type_parameters_compatibile( &old_struct.type_parameters, &new_struct.type_parameters, ) @@ -119,7 +119,7 @@ impl Compatibility { if !is_vis_compatible || old_func.parameters != new_func.parameters || old_func.return_ != new_func.return_ - || !type_parameters_compatibile( + || !fun_type_parameters_compatibile( &old_func.type_parameters, &new_func.type_parameters, ) @@ -157,7 +157,7 @@ fn struct_abilities_compatibile(old_abilities: AbilitySet, new_abilities: Abilit // When upgrading, the new type parameters must be the same length, and the new type parameter // constraints must be compatible -fn type_parameters_compatibile( +fn fun_type_parameters_compatibile( old_type_parameters: &[AbilitySet], new_type_parameters: &[AbilitySet], ) -> bool { @@ -172,6 +172,22 @@ fn type_parameters_compatibile( ) } +fn struct_type_parameters_compatibile( + old_type_parameters: &[StructTypeParameter], + new_type_parameters: &[StructTypeParameter], +) -> bool { + old_type_parameters.len() == new_type_parameters.len() + && old_type_parameters.iter().zip(new_type_parameters).all( + |(old_type_parameter, new_type_parameter)| { + type_parameter_phantom_decl_compatibile(old_type_parameter, new_type_parameter) + && type_parameter_constraints_compatibile( + old_type_parameter.constraints, + new_type_parameter.constraints, + ) + }, + ) +} + // When upgrading, the new constraints must be a subset of (or equal to) the old constraints. // Removing an ability is fine, but adding an ability could cause existing callsites to fail fn type_parameter_constraints_compatibile( @@ -180,3 +196,14 @@ fn type_parameter_constraints_compatibile( ) -> bool { new_type_constraints.is_subset(old_type_constraints) } + +// Adding a phantom annotation to a parameter won't break clients because that can only increase the +// the set of abilities in struct instantiations. Put it differently, adding phantom declarations +// relaxes the requirements for clients. +fn type_parameter_phantom_decl_compatibile( + old_type_parameter: &StructTypeParameter, + new_type_parameter: &StructTypeParameter, +) -> bool { + // old_type_paramter.is_phantom => new_type_parameter.is_phantom + !old_type_parameter.is_phantom || new_type_parameter.is_phantom +} diff --git a/language/move-binary-format/src/deserializer.rs b/language/move-binary-format/src/deserializer.rs index da4ceca3d337..b61b6050707e 100644 --- a/language/move-binary-format/src/deserializer.rs +++ b/language/move-binary-format/src/deserializer.rs @@ -633,8 +633,7 @@ fn load_struct_handles( let module = load_module_handle_index(&mut cursor)?; let name = load_identifier_index(&mut cursor)?; let abilities = load_ability_set(&mut cursor, AbilitySetPosition::StructHandle)?; - let type_parameters = - load_ability_sets(&mut cursor, AbilitySetPosition::StructTypeParameters)?; + let type_parameters = load_struct_type_parameters(&mut cursor)?; struct_handles.push(StructHandle { module, name, @@ -1050,6 +1049,33 @@ fn load_ability_sets( Ok(kinds) } +fn load_struct_type_parameters( + cursor: &mut VersionedCursor, +) -> BinaryLoaderResult> { + let len = load_type_parameter_count(cursor)?; + let mut type_params = Vec::with_capacity(len); + for _ in 0..len { + type_params.push(load_struct_type_parameter(cursor)?); + } + Ok(type_params) +} + +fn load_struct_type_parameter( + cursor: &mut VersionedCursor, +) -> BinaryLoaderResult { + let constraints = load_ability_set(cursor, AbilitySetPosition::StructTypeParameters)?; + let is_phantom = if cursor.version() < VERSION_3 { + false + } else { + let byte: u8 = read_uleb_internal(cursor, 1)?; + byte != 0 + }; + Ok(StructTypeParameter { + constraints, + is_phantom, + }) +} + /// Builds the `StructDefinition` table. fn load_struct_defs( binary: &VersionedBinary, @@ -1180,7 +1206,7 @@ fn load_function_def(cursor: &mut VersionedCursor) -> BinaryLoaderResult { + VERSION_2 | VERSION_3 => { // NOTE: changes compared with VERSION_1 // - in VERSION_1: the flags is a byte compositing both the visibility info and whether // the function is a native function diff --git a/language/move-binary-format/src/file_format.rs b/language/move-binary-format/src/file_format.rs index 3fafd86ceeaa..7aa9c9ae2a8b 100644 --- a/language/move-binary-format/src/file_format.rs +++ b/language/move-binary-format/src/file_format.rs @@ -249,8 +249,25 @@ pub struct StructHandle { /// For any instantiation of this type, the abilities of this type are predicated on /// that ability being satisfied for all type parameters. pub abilities: AbilitySet, - /// The type formals (identified by their index into the vec) and their constraints - pub type_parameters: Vec, + /// The type formals (identified by their index into the vec) + pub type_parameters: Vec, +} + +impl StructHandle { + pub fn type_param_constraints(&self) -> impl ExactSizeIterator + '_ { + self.type_parameters.iter().map(|param| param.constraints) + } +} + +/// A type parameter used in the declaration of a struct. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] +#[cfg_attr(any(test, feature = "fuzzing"), derive(Arbitrary))] +#[cfg_attr(any(test, feature = "fuzzing"), proptest(no_params))] +pub struct StructTypeParameter { + /// The type parameter constraints. + pub constraints: AbilitySet, + /// Whether the parameter is declared as phantom. + pub is_phantom: bool, } /// A `FunctionHandle` is a reference to a function. It is composed by a @@ -647,23 +664,42 @@ impl AbilitySet { } /// For a polymorphic type, its actual abilities correspond to its declared abilities but - /// predicated on its type arguments having that ability. For `Key`, instead of needing - /// the same ability, the type arguments need `Store` - pub fn polymorphic_abilities( + /// predicated on its non-phantom type arguments having that ability. For `Key`, instead of needing + /// the same ability, the type arguments need `Store`. + pub fn polymorphic_abilities( declared_abilities: Self, - type_argument_abilities: impl IntoIterator, - ) -> Self { + declared_phantom_parameters: I1, + type_arguments: I2, + ) -> PartialVMResult + where + I1: IntoIterator, + I2: IntoIterator, + I1::IntoIter: ExactSizeIterator, + I2::IntoIter: ExactSizeIterator, + { + let declared_phantom_parameters = declared_phantom_parameters.into_iter(); + let type_arguments = type_arguments.into_iter(); + + if declared_phantom_parameters.len() != type_arguments.len() { + return Err( + PartialVMError::new(StatusCode::VERIFIER_INVARIANT_VIOLATION).with_message( + "the length of `declared_phantom_parameters` doesn't match the length of `type_arguments`".to_string(), + ), + ); + } + // Conceptually this is performing the following operation: // For any ability 'a' in `declared_abilities` // 'a' is in the result only if - // for all 'ti' in `type_argument_abilities`, a.required() is a subset of ti + // for all (abi_i, is_phantom_i) in `type_arguments` s.t. !is_phantom then a.required() is a subset of abi_i // // So to do this efficiently, we can determine the required_by set for each ti // and intersect them together along with the declared abilities // This only works because for any ability y, |y.requires()| == 1 - type_argument_abilities - .into_iter() - .map(|ty_arg_abilities| { + let abs = type_arguments + .zip(declared_phantom_parameters) + .filter(|(_, is_phantom)| !is_phantom) + .map(|(ty_arg_abilities, _)| { ty_arg_abilities .into_iter() .map(|a| a.required_by()) @@ -671,7 +707,8 @@ impl AbilitySet { }) .fold(declared_abilities, |acc, ty_arg_abilities| { acc.intersect(ty_arg_abilities) - }) + }); + Ok(abs) } pub fn from_u8(byte: u8) -> Option { diff --git a/language/move-binary-format/src/file_format_common.rs b/language/move-binary-format/src/file_format_common.rs index c45e58a3260b..6b5d702498db 100644 --- a/language/move-binary-format/src/file_format_common.rs +++ b/language/move-binary-format/src/file_format_common.rs @@ -358,8 +358,12 @@ pub const VERSION_1: u32 = 1; /// + friend list for modules pub const VERSION_2: u32 = 2; +/// Version 3: changes compared with version 2 +/// + phantom type parameters +pub const VERSION_3: u32 = 3; + // Mark which version is the latest version -pub const VERSION_MAX: u32 = VERSION_2; +pub const VERSION_MAX: u32 = VERSION_3; pub(crate) mod versioned_data { use crate::{errors::*, file_format_common::*}; diff --git a/language/move-binary-format/src/normalized.rs b/language/move-binary-format/src/normalized.rs index 8a0c28e002bb..53ac42890157 100644 --- a/language/move-binary-format/src/normalized.rs +++ b/language/move-binary-format/src/normalized.rs @@ -5,7 +5,8 @@ use crate::{ access::ModuleAccess, file_format::{ AbilitySet, CompiledModule, FieldDefinition, FunctionDefinition, SignatureToken, - StructDefinition, StructFieldInformation, TypeParameterIndex, Visibility, + StructDefinition, StructFieldInformation, StructTypeParameter, TypeParameterIndex, + Visibility, }, }; use move_core_types::{ @@ -60,7 +61,7 @@ pub struct Field { #[derive(Clone, Debug, Eq, PartialEq)] pub struct Struct { pub abilities: AbilitySet, - pub type_parameters: Vec, + pub type_parameters: Vec, pub fields: Vec, } @@ -241,6 +242,10 @@ impl Struct { }; (name, s) } + + pub fn type_param_constraints(&self) -> impl ExactSizeIterator { + self.type_parameters.iter().map(|param| ¶m.constraints) + } } impl Function { diff --git a/language/move-binary-format/src/proptest_types/functions.rs b/language/move-binary-format/src/proptest_types/functions.rs index 6108298090f8..b2be4315449a 100644 --- a/language/move-binary-format/src/proptest_types/functions.rs +++ b/language/move-binary-format/src/proptest_types/functions.rs @@ -302,7 +302,10 @@ impl<'a> FnDefnMaterializeState<'a> { FunctionHandleIndex((self.function_handles.len() - 1) as TableIndex) } - fn get_signature_from_type_params(&mut self, abilities: &[AbilitySet]) -> Signature { + fn get_signature_from_type_params( + &mut self, + abilities: impl IntoIterator, + ) -> Signature { let mut type_params = vec![]; for abs in abilities { assert!(!abs.has_key()); @@ -314,14 +317,17 @@ impl<'a> FnDefnMaterializeState<'a> { Signature(type_params) } - fn add_signature_from_type_params(&mut self, abilities: &[AbilitySet]) -> SignatureIndex { + fn add_signature_from_type_params( + &mut self, + abilities: impl IntoIterator, + ) -> SignatureIndex { let sig = self.get_signature_from_type_params(abilities); self.signatures.add_signature(sig) } fn get_function_instantiation(&mut self, fh_idx: usize) -> FunctionInstantiationIndex { let abilities = self.function_handles[fh_idx].type_parameters.clone(); - let sig_idx = self.add_signature_from_type_params(&abilities); + let sig_idx = self.add_signature_from_type_params(abilities.iter().copied()); let fi = FunctionInstantiation { handle: FunctionHandleIndex(fh_idx as TableIndex), type_parameters: sig_idx, @@ -331,10 +337,8 @@ impl<'a> FnDefnMaterializeState<'a> { fn get_type_instantiation(&mut self, sd_idx: usize) -> StructDefInstantiationIndex { let sd = &self.struct_defs[sd_idx]; - let type_parameters = self.struct_handles[sd.struct_handle.0 as usize] - .type_parameters - .clone(); - let sig_idx = self.add_signature_from_type_params(&type_parameters); + let struct_handle = &self.struct_handles[sd.struct_handle.0 as usize]; + let sig_idx = self.add_signature_from_type_params(struct_handle.type_param_constraints()); let si = StructDefInstantiation { def: StructDefinitionIndex(sd_idx as TableIndex), type_parameters: sig_idx, @@ -555,13 +559,13 @@ impl BytecodeGen { field: field.index(*field_count) as TableIndex, }); - let type_parameters = &state.struct_handles - [state.struct_defs[sd_idx].struct_handle.0 as usize] - .type_parameters; - if type_parameters.is_empty() { + let struct_handle = + &state.struct_handles[state.struct_defs[sd_idx].struct_handle.0 as usize]; + if struct_handle.type_parameters.is_empty() { Bytecode::MutBorrowField(fh_idx) } else { - let sig_idx = state.add_signature_from_type_params(&type_parameters.clone()); + let sig_idx = state + .add_signature_from_type_params(struct_handle.type_param_constraints()); let fi_idx = state .field_instantiations .add_instantiation(FieldInstantiation { @@ -582,13 +586,13 @@ impl BytecodeGen { field: field.index(*field_count) as TableIndex, }); - let type_parameters = &state.struct_handles - [state.struct_defs[sd_idx].struct_handle.0 as usize] - .type_parameters; - if type_parameters.is_empty() { + let struct_handle = + &state.struct_handles[state.struct_defs[sd_idx].struct_handle.0 as usize]; + if struct_handle.type_parameters.is_empty() { Bytecode::ImmBorrowField(fh_idx) } else { - let sig_idx = state.add_signature_from_type_params(&type_parameters.clone()); + let sig_idx = state + .add_signature_from_type_params(struct_handle.type_param_constraints()); let fi_idx = state .field_instantiations .add_instantiation(FieldInstantiation { diff --git a/language/move-binary-format/src/proptest_types/signature.rs b/language/move-binary-format/src/proptest_types/signature.rs index 108ef76a5736..6d7eb957ef15 100644 --- a/language/move-binary-format/src/proptest_types/signature.rs +++ b/language/move-binary-format/src/proptest_types/signature.rs @@ -174,7 +174,8 @@ impl SignatureTokenGen { SignatureToken::Struct(StructHandleIndex(struct_idx as TableIndex)) } else { let mut type_params = vec![]; - for abs in &sh.type_parameters { + for type_param in &sh.type_parameters { + let abs = type_param.constraints; assert!(!abs.has_key()); match (abs.has_copy(), abs.has_drop(), abs.has_store()) { (false, true, false) => type_params.push(SignatureToken::Signer), diff --git a/language/move-binary-format/src/proptest_types/types.rs b/language/move-binary-format/src/proptest_types/types.rs index 3c59e6276e9c..fd5422836cb5 100644 --- a/language/move-binary-format/src/proptest_types/types.rs +++ b/language/move-binary-format/src/proptest_types/types.rs @@ -4,8 +4,8 @@ use crate::{ file_format::{ AbilitySet, FieldDefinition, IdentifierIndex, ModuleHandleIndex, SignatureToken, - StructDefinition, StructFieldInformation, StructHandle, StructHandleIndex, TableIndex, - TypeSignature, + StructDefinition, StructFieldInformation, StructHandle, StructHandleIndex, + StructTypeParameter, TableIndex, TypeSignature, }, internals::ModuleIndex, proptest_types::{ @@ -91,16 +91,17 @@ pub struct StructHandleGen { module_idx: PropIndex, name_idx: PropIndex, abilities: AbilitySetGen, - type_parameters: Vec, + type_parameters: Vec<(AbilitySetGen, bool)>, } impl StructHandleGen { pub fn strategy(ability_count: impl Into) -> impl Strategy { + let ability_count = ability_count.into(); ( any::(), any::(), AbilitySetGen::strategy(), - vec(AbilitySetGen::strategy(), ability_count), + vec((AbilitySetGen::strategy(), any::()), ability_count), ) .prop_map(|(module_idx, name_idx, abilities, type_parameters)| Self { module_idx, @@ -121,10 +122,14 @@ impl StructHandleGen { self_module_handle_idx.into_index(), module_len, ); - let mut type_parameters = vec![]; - for type_param in self.type_parameters { - type_parameters.push(type_param.materialize()); - } + let type_parameters = self + .type_parameters + .into_iter() + .map(|(constraints, is_phantom)| StructTypeParameter { + constraints: constraints.materialize(), + is_phantom, + }) + .collect(); StructHandle { module: ModuleHandleIndex(idx as TableIndex), name: IdentifierIndex(self.name_idx.index(identifiers_len) as TableIndex), @@ -138,7 +143,7 @@ impl StructHandleGen { pub struct StructDefinitionGen { name_idx: PropIndex, abilities: AbilitySetGen, - type_parameters: Vec, + type_parameters: Vec<(AbilitySetGen, bool)>, is_public: bool, field_defs: Option>, } @@ -151,7 +156,10 @@ impl StructDefinitionGen { ( any::(), AbilitySetGen::strategy(), - vec(AbilitySetGen::strategy(), type_parameter_count), + vec( + (AbilitySetGen::strategy(), any::()), + type_parameter_count, + ), any::(), option::of(vec(FieldDefinitionGen::strategy(), field_count)), ) @@ -188,15 +196,20 @@ impl StructDefinitionGen { .fold(self.abilities.materialize(), |acc, field| { acc.intersect(state.potential_abilities(&field.signature.0)) }); + + let type_parameters = self + .type_parameters + .into_iter() + .map(|(constraints, is_phantom)| StructTypeParameter { + constraints: constraints.materialize(), + is_phantom, + }) + .collect(); let handle = StructHandle { module: state.self_module_handle_idx, name: IdentifierIndex(self.name_idx.index(state.identifiers_len) as TableIndex), abilities, - type_parameters: self - .type_parameters - .into_iter() - .map(|abilities| abilities.materialize()) - .collect(), + type_parameters, }; match state.add_struct_handle(handle) { Some(struct_handle) => { diff --git a/language/move-binary-format/src/serializer.rs b/language/move-binary-format/src/serializer.rs index 8247ef8aad02..54400ff680db 100644 --- a/language/move-binary-format/src/serializer.rs +++ b/language/move-binary-format/src/serializer.rs @@ -394,7 +394,26 @@ fn serialize_struct_handle(binary: &mut BinaryData, struct_handle: &StructHandle serialize_module_handle_index(binary, &struct_handle.module)?; serialize_identifier_index(binary, &struct_handle.name)?; serialize_ability_set(binary, struct_handle.abilities)?; - serialize_ability_sets(binary, &struct_handle.type_parameters) + serialize_type_parameters(binary, &struct_handle.type_parameters) +} + +fn serialize_type_parameters( + binary: &mut BinaryData, + type_parameters: &[StructTypeParameter], +) -> Result<()> { + serialize_type_parameter_count(binary, type_parameters.len())?; + for type_param in type_parameters { + serialize_type_parameter(binary, type_param)?; + } + Ok(()) +} + +fn serialize_type_parameter( + binary: &mut BinaryData, + type_param: &StructTypeParameter, +) -> Result<()> { + serialize_ability_set(binary, type_param.constraints)?; + write_as_uleb128(binary, type_param.is_phantom as u8, 1u64) } /// Serializes a `FunctionHandle`. diff --git a/language/move-binary-format/src/views.rs b/language/move-binary-format/src/views.rs index 025585a621e1..dadb27becb04 100644 --- a/language/move-binary-format/src/views.rs +++ b/language/move-binary-format/src/views.rs @@ -219,7 +219,7 @@ impl<'a, T: ModuleAccess> StructHandleView<'a, T> { self.struct_handle.abilities } - pub fn type_parameters(&self) -> &Vec { + pub fn type_parameters(&self) -> &Vec { &self.struct_handle.type_parameters } @@ -356,7 +356,7 @@ impl<'a, T: ModuleAccess> StructDefinitionView<'a, T> { } } - pub fn type_parameters(&self) -> &Vec { + pub fn type_parameters(&self) -> &Vec { self.struct_handle_view.type_parameters() } diff --git a/language/move-core/types/src/vm_status.rs b/language/move-core/types/src/vm_status.rs index 363bd4fa7e60..f1593059788c 100644 --- a/language/move-core/types/src/vm_status.rs +++ b/language/move-core/types/src/vm_status.rs @@ -573,6 +573,9 @@ pub enum StatusCode { INVALID_FRIEND_DECL_WITH_MODULES_IN_DEPENDENCIES = 1106, // The updated module introduces a cyclic friendship (i.e., A friends B and B also friends A) CYCLIC_MODULE_FRIENDSHIP = 1107, + // A phantom type parameter was used in a non-phantom position. + INVALID_PHANTOM_TYPE_PARAM_POSITION = 1108, + // These are errors that the VM might raise if a violation of internal // invariants takes place. diff --git a/language/move-lang/src/interface_generator.rs b/language/move-lang/src/interface_generator.rs index 0f37d89a5e78..9d338adf42d6 100644 --- a/language/move-lang/src/interface_generator.rs +++ b/language/move-lang/src/interface_generator.rs @@ -7,8 +7,8 @@ use move_binary_format::{ access::ModuleAccess, file_format::{ Ability, AbilitySet, CompiledModule, FunctionDefinition, ModuleHandle, SignatureToken, - StructDefinition, StructFieldInformation, StructHandleIndex, TypeParameterIndex, - Visibility, + StructDefinition, StructFieldInformation, StructHandleIndex, StructTypeParameter, + TypeParameterIndex, Visibility, }, }; use move_core_types::language_storage::ModuleId; @@ -159,7 +159,7 @@ fn write_struct_def(ctx: &mut Context, sdef: &StructDefinition) -> String { format!( " struct {}{}{} {{", ctx.module.identifier_at(shandle.name), - write_type_parameters(&shandle.type_parameters), + write_struct_type_parameters(&shandle.type_parameters), write_ability_modifiers(shandle.abilities), ) ); @@ -194,7 +194,7 @@ fn write_function_def(ctx: &mut Context, fdef: &FunctionDefinition) -> String { " native {}fun {}{}({}){};", write_visibility(fdef.visibility), ctx.module.identifier_at(fhandle.name), - write_type_parameters(&fhandle.type_parameters), + write_fun_type_parameters(&fhandle.type_parameters), write_parameters(ctx, parameters), write_return_type(ctx, return_) ) @@ -247,7 +247,28 @@ fn write_ability(ab: Ability) -> String { .to_string() } -fn write_type_parameters(tps: &[AbilitySet]) -> String { +fn write_struct_type_parameters(tps: &[StructTypeParameter]) -> String { + if tps.is_empty() { + return "".to_string(); + } + + let tp_and_constraints = tps + .iter() + .enumerate() + .map(|(idx, ty_param)| { + format!( + "{}{}{}", + if ty_param.is_phantom { "phantom " } else { "" }, + write_type_parameter(idx as TypeParameterIndex), + write_ability_constraint(ty_param.constraints), + ) + }) + .collect::>() + .join(", "); + format!("<{}>", tp_and_constraints) +} + +fn write_fun_type_parameters(tps: &[AbilitySet]) -> String { if tps.is_empty() { return "".to_string(); } diff --git a/language/move-model/src/model.rs b/language/move-model/src/model.rs index 10e2d97b1159..74c20a292ae5 100644 --- a/language/move-model/src/model.rs +++ b/language/move-model/src/model.rs @@ -2221,6 +2221,17 @@ impl<'env> StructEnv<'env> { unreachable!("invalid field lookup") } + /// Whether the type parameter at position `idx` is declared as phantom. + pub fn is_phantom_parameter(&self, idx: usize) -> bool { + let def = self.module_env.data.module.struct_def_at(self.data.def_idx); + self.module_env + .data + .module + .struct_handle_at(def.struct_handle) + .type_parameters[idx] + .is_phantom + } + /// Returns the type parameters associated with this struct. pub fn get_type_parameters(&self) -> Vec { // TODO: we currently do not know the original names of those formals, so we generate them. @@ -2234,7 +2245,7 @@ impl<'env> StructEnv<'env> { .map(|(i, k)| { TypeParameter( self.module_env.env.symbol_pool.make(&format!("$tv{}", i)), - AbilityConstraint(*k), + AbilityConstraint(k.constraints), ) }) .collect_vec() @@ -2261,7 +2272,7 @@ impl<'env> StructEnv<'env> { .unwrap_or_else(|| format!("unknown#{}", i)); TypeParameter( self.module_env.env.symbol_pool.make(&name), - AbilityConstraint(*k), + AbilityConstraint(k.constraints), ) }) .collect_vec() diff --git a/language/move-prover/interpreter/src/concrete/runtime.rs b/language/move-prover/interpreter/src/concrete/runtime.rs index f9681d016082..c0c24e48bc91 100644 --- a/language/move-prover/interpreter/src/concrete/runtime.rs +++ b/language/move-prover/interpreter/src/concrete/runtime.rs @@ -287,13 +287,14 @@ fn check_type_instantiation( } fn get_abilities(env: &GlobalEnv, ty: &TypeTag) -> PartialVMResult { - let abilities = match ty { + match ty { TypeTag::Bool | TypeTag::U8 | TypeTag::U64 | TypeTag::U128 | TypeTag::Address => { - AbilitySet::PRIMITIVES + Ok(AbilitySet::PRIMITIVES) } - TypeTag::Signer => AbilitySet::SIGNER, + TypeTag::Signer => Ok(AbilitySet::SIGNER), TypeTag::Vector(elem_ty) => AbilitySet::polymorphic_abilities( AbilitySet::VECTOR, + vec![false], vec![get_abilities(env, elem_ty)?], ), TypeTag::Struct(struct_tag) => { @@ -306,13 +307,18 @@ fn get_abilities(env: &GlobalEnv, ty: &TypeTag) -> PartialVMResult { )) })?; let struct_env = env.get_struct(struct_id); + let declared_phantom_parameters = (0..struct_env.get_type_parameters().len()) + .map(|idx| struct_env.is_phantom_parameter(idx)); let ty_arg_abilities = struct_tag .type_params .iter() .map(|arg| get_abilities(env, arg)) .collect::>>()?; - AbilitySet::polymorphic_abilities(struct_env.get_abilities(), ty_arg_abilities) + AbilitySet::polymorphic_abilities( + struct_env.get_abilities(), + declared_phantom_parameters, + ty_arg_abilities, + ) } - }; - Ok(abilities) + } } diff --git a/language/move-vm/runtime/src/loader.rs b/language/move-vm/runtime/src/loader.rs index 7dd9c1d7e9fa..130bd8383687 100644 --- a/language/move-vm/runtime/src/loader.rs +++ b/language/move-vm/runtime/src/loader.rs @@ -778,7 +778,7 @@ impl Loader { for ty_param in &struct_tag.type_params { type_params.push(self.load_type(ty_param, data_store)?); } - self.verify_ty_args(&struct_type.type_parameters, &type_params) + self.verify_ty_args(struct_type.type_param_constraints(), &type_params) .map_err(|e| e.finish(Location::Undefined))?; Type::StructInstantiation(idx, type_params) } @@ -896,7 +896,12 @@ impl Loader { // Verify the kind (constraints) of an instantiation. // Both function and script invocation use this function to verify correctness // of type arguments provided - fn verify_ty_args(&self, constraints: &[AbilitySet], ty_args: &[Type]) -> PartialVMResult<()> { + fn verify_ty_args<'a, I>(&self, constraints: I, ty_args: &[Type]) -> PartialVMResult<()> + where + I: IntoIterator, + I::IntoIter: ExactSizeIterator, + { + let constraints = constraints.into_iter(); if constraints.len() != ty_args.len() { return Err(PartialVMError::new( StatusCode::NUMBER_OF_TYPE_ARGUMENTS_MISMATCH, @@ -952,21 +957,27 @@ impl Loader { "Unexpected TyParam type after translating from TypeTag to Type".to_string(), )), - Type::Vector(ty) => Ok(AbilitySet::polymorphic_abilities( + Type::Vector(ty) => AbilitySet::polymorphic_abilities( AbilitySet::VECTOR, - vec![self.abilities(ty)?].into_iter(), - )), + vec![false], + vec![self.abilities(ty)?], + ), Type::Struct(idx) => Ok(self.module_cache.read().struct_at(*idx).abilities), Type::StructInstantiation(idx, type_args) => { - let declared_abilities = self.module_cache.read().struct_at(*idx).abilities; + let struct_type = self.module_cache.read().struct_at(*idx); + let declared_phantom_parameters = struct_type + .type_parameters + .iter() + .map(|param| param.is_phantom); let type_argument_abilities = type_args .iter() - .map(|ty| self.abilities(ty)) + .map(|arg| self.abilities(arg)) .collect::>>()?; - Ok(AbilitySet::polymorphic_abilities( - declared_abilities, + AbilitySet::polymorphic_abilities( + struct_type.abilities, + declared_phantom_parameters, type_argument_abilities, - )) + ) } } } diff --git a/language/move-vm/types/src/loaded_data/runtime_types.rs b/language/move-vm/types/src/loaded_data/runtime_types.rs index c548b7d98e15..196db2bbf156 100644 --- a/language/move-vm/types/src/loaded_data/runtime_types.rs +++ b/language/move-vm/types/src/loaded_data/runtime_types.rs @@ -3,7 +3,7 @@ use move_binary_format::{ errors::{PartialVMError, PartialVMResult}, - file_format::{AbilitySet, StructDefinitionIndex}, + file_format::{AbilitySet, StructDefinitionIndex, StructTypeParameter}, }; use move_core_types::{identifier::Identifier, language_storage::ModuleId, vm_status::StatusCode}; @@ -13,12 +13,18 @@ pub const TYPE_DEPTH_MAX: usize = 256; pub struct StructType { pub fields: Vec, pub abilities: AbilitySet, - pub type_parameters: Vec, + pub type_parameters: Vec, pub name: Identifier, pub module: ModuleId, pub struct_def: StructDefinitionIndex, } +impl StructType { + pub fn type_param_constraints(&self) -> impl ExactSizeIterator { + self.type_parameters.iter().map(|param| ¶m.constraints) + } +} + #[derive(Debug, Clone, Eq, Hash, Ord, PartialEq, PartialOrd)] pub enum Type { Bool, diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__borrow_after_move.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__borrow_after_move.exp index 7a8e4e57a3b7..fb24b3c39c15 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__borrow_after_move.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__borrow_after_move.exp @@ -1,4 +1,4 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90b00000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b02000000090100040204040308190521140735420877200a9701050c9c014f0deb010200000101000208000003000100000402010000050001000006000100010800040001060c0002060c03010608000105010708000103014d065369676e657202543109626f72726f775f7431096368616e67655f74310972656d6f76655f74310a7075626c6973685f743101760a616464726573735f6f663eebd722df1633f4bf38f1e2087222e9000000000000000000000000000000010002010703000100010003050b0011042b000c0102010100010005090b0011042a000c020b010b020f001502020100010006060b0011042c0013000c01020301000001050b0006030000000000000012002d0002000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90b00000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b03000000090100040204040308190521140735420877200a9701050c9c014f0deb010200000101000208000003000100000402010000050001000006000100010800040001060c0002060c03010608000105010708000103014d065369676e657202543109626f72726f775f7431096368616e67655f74310972656d6f76655f74310a7075626c6973685f743101760a616464726573735f6f663eebd722df1633f4bf38f1e2087222e9000000000000000000000000000000010002010703000100010003050b0011042b000c0102010100010005090b0011042a000c020b010b020f001502020100010006060b0011042c0013000c01020301000001050b0006030000000000000012002d0002000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90c00000000000000))] }), events: [], gas_used: 9, status: Keep(EXECUTION_FAILURE { location: 3EEBD722DF1633F4BF38F1E2087222E9::M, function_definition: 2, code_offset: 2 }) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90d00000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 013eebd722df1633f4bf38f1e2087222e9014d02543100 }, Value(0300000000000000))] }), events: [], gas_used: 12, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90e00000000000000))] }), events: [], gas_used: 18, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__change_after_move.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__change_after_move.exp index dcb487c77f77..a8523f1c7b6f 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__change_after_move.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__change_after_move.exp @@ -1,4 +1,4 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90b00000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b02000000090100040204040308190521140735420877200a9701050c9c014f0deb010200000101000208000003000100000402010000050001000006000100010800040001060c0002060c03010608000105010708000103014d065369676e657202543109626f72726f775f7431096368616e67655f74310972656d6f76655f74310a7075626c6973685f743101760a616464726573735f6f663eebd722df1633f4bf38f1e2087222e9000000000000000000000000000000010002010703000100010003050b0011042b000c0102010100010005090b0011042a000c020b010b020f001502020100010006060b0011042c0013000c01020301000001050b0006030000000000000012002d0002000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90b00000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b03000000090100040204040308190521140735420877200a9701050c9c014f0deb010200000101000208000003000100000402010000050001000006000100010800040001060c0002060c03010608000105010708000103014d065369676e657202543109626f72726f775f7431096368616e67655f74310972656d6f76655f74310a7075626c6973685f743101760a616464726573735f6f663eebd722df1633f4bf38f1e2087222e9000000000000000000000000000000010002010703000100010003050b0011042b000c0102010100010005090b0011042a000c020b010b020f001502020100010006060b0011042c0013000c01020301000001050b0006030000000000000012002d0002000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90c00000000000000))] }), events: [], gas_used: 9, status: Keep(EXECUTION_FAILURE { location: 3EEBD722DF1633F4BF38F1E2087222E9::M, function_definition: 2, code_offset: 2 }) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90d00000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 013eebd722df1633f4bf38f1e2087222e9014d02543100 }, Value(0300000000000000))] }), events: [], gas_used: 12, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90e00000000000000))] }), events: [], gas_used: 18, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__move_from_across_blocks.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__move_from_across_blocks.exp index 5426210ebeb2..9773daf7d545 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__move_from_across_blocks.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__move_from_across_blocks.exp @@ -1,4 +1,4 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90b00000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b02000000090100040204040308190521140735420877200a9701050c9c014f0deb010200000101000208000003000100000402010000050001000006000100010800040001060c0002060c03010608000105010708000103014d065369676e657202543109626f72726f775f7431096368616e67655f74310972656d6f76655f74310a7075626c6973685f743101760a616464726573735f6f663eebd722df1633f4bf38f1e2087222e9000000000000000000000000000000010002010703000100010003050b0011042b000c0102010100010005090b0011042a000c020b010b020f001502020100010006060b0011042c0013000c01020301000001050b0006030000000000000012002d0002000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90b00000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b03000000090100040204040308190521140735420877200a9701050c9c014f0deb010200000101000208000003000100000402010000050001000006000100010800040001060c0002060c03010608000105010708000103014d065369676e657202543109626f72726f775f7431096368616e67655f74310972656d6f76655f74310a7075626c6973685f743101760a616464726573735f6f663eebd722df1633f4bf38f1e2087222e9000000000000000000000000000000010002010703000100010003050b0011042b000c0102010100010005090b0011042a000c020b010b020f001502020100010006060b0011042c0013000c01020301000001050b0006030000000000000012002d0002000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90c00000000000000))] }), events: [], gas_used: 9, status: Keep(EXECUTION_FAILURE { location: 3EEBD722DF1633F4BF38F1E2087222E9::M, function_definition: 2, code_offset: 2 }) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90d00000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 013eebd722df1633f4bf38f1e2087222e9014d02543100 }, Value(0300000000000000))] }), events: [], gas_used: 12, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90e00000000000000))] }), events: [], gas_used: 18, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__duplicate_module.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__duplicate_module.exp index 5207fb6910f0..210c2d55bbb7 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__duplicate_module.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__duplicate_module.exp @@ -1,2 +1,2 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0200000008010002020204030605050b01070c060812100a22050c2707000000010000000200000000014d015401663eebd722df1633f4bf38f1e2087222e900020102030001000000010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90400000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0200000008010002020204030605050b01070c060812100a22050c2707000000010000000200000000014d015401663eebd722df1633f4bf38f1e2087222e900020102030001000000010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0300000008010002020204030605050b01070c060812100a22050c2707000000010000000200000000014d015401663eebd722df1633f4bf38f1e2087222e900020102030001000000010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90400000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0300000008010002020204030605050b01070c060812100a22050c2707000000010000000200000000014d015401663eebd722df1633f4bf38f1e2087222e900020102030001000000010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_compatible_module.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_compatible_module.exp index 72c4aa101d75..6278b4842c2a 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_compatible_module.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_compatible_module.exp @@ -1,2 +1,2 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b02000000030100020702020804100000014d3eebd722df1633f4bf38f1e2087222e900))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90400000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0200000005010002020204070606080c100a1c05000000010000014d015401663eebd722df1633f4bf38f1e2087222e9000201020300))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b03000000030100020702020804100000014d3eebd722df1633f4bf38f1e2087222e900))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90400000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0300000005010002020204070606080c100a1c05000000010000014d015401663eebd722df1633f4bf38f1e2087222e9000201020300))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_changed_field.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_changed_field.exp index aee2efc86a5c..7c91877dfc03 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_changed_field.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_changed_field.exp @@ -1,2 +1,2 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0200000005010002020204070606080c100a1c05000000010000014d015401663eebd722df1633f4bf38f1e2087222e9000201020300))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0300000005010002020204070606080c100a1c05000000010000014d015401663eebd722df1633f4bf38f1e2087222e9000201020300))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90400000000000000))] }), events: [], gas_used: 1, status: Keep(MISCELLANEOUS_ERROR) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_new_field.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_new_field.exp index aee2efc86a5c..7c91877dfc03 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_new_field.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_new_field.exp @@ -1,2 +1,2 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0200000005010002020204070606080c100a1c05000000010000014d015401663eebd722df1633f4bf38f1e2087222e9000201020300))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0300000005010002020204070606080c100a1c05000000010000014d015401663eebd722df1633f4bf38f1e2087222e9000201020300))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90400000000000000))] }), events: [], gas_used: 1, status: Keep(MISCELLANEOUS_ERROR) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_removed_field.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_removed_field.exp index aee2efc86a5c..7c91877dfc03 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_removed_field.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_removed_field.exp @@ -1,2 +1,2 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0200000005010002020204070606080c100a1c05000000010000014d015401663eebd722df1633f4bf38f1e2087222e9000201020300))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0300000005010002020204070606080c100a1c05000000010000014d015401663eebd722df1633f4bf38f1e2087222e9000201020300))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90400000000000000))] }), events: [], gas_used: 1, status: Keep(MISCELLANEOUS_ERROR) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_removed_struct.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_removed_struct.exp index aee2efc86a5c..7c91877dfc03 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_removed_struct.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__layout_incompatible_module_with_removed_struct.exp @@ -1,2 +1,2 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0200000005010002020204070606080c100a1c05000000010000014d015401663eebd722df1633f4bf38f1e2087222e9000201020300))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0300000005010002020204070606080c100a1c05000000010000014d015401663eebd722df1633f4bf38f1e2087222e9000201020300))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90400000000000000))] }), events: [], gas_used: 1, status: Keep(MISCELLANEOUS_ERROR) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_compatible_module.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_compatible_module.exp index f61a9a7ea4b3..eeae01394f00 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_compatible_module.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_compatible_module.exp @@ -1,2 +1,2 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b02000000030100020702020804100000014d3eebd722df1633f4bf38f1e2087222e900))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90400000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0200000006010002030205050701070804080c100c1c070000000100000000014d01663eebd722df1633f4bf38f1e2087222e90001000000010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b03000000030100020702020804100000014d3eebd722df1633f4bf38f1e2087222e900))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90400000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0300000006010002030205050701070804080c100c1c070000000100000000014d01663eebd722df1633f4bf38f1e2087222e90001000000010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_incompatible_module_with_added_param.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_incompatible_module_with_added_param.exp index 12559f6cec10..e37bc05366bb 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_incompatible_module_with_added_param.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_incompatible_module_with_added_param.exp @@ -1,2 +1,2 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0200000006010002030205050701070804080c100c1c070000000100000000014d01663eebd722df1633f4bf38f1e2087222e90001000000010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0300000006010002030205050701070804080c100c1c070000000100000000014d01663eebd722df1633f4bf38f1e2087222e90001000000010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90400000000000000))] }), events: [], gas_used: 1, status: Keep(MISCELLANEOUS_ERROR) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_incompatible_module_with_changed_param.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_incompatible_module_with_changed_param.exp index aac3d6ac4571..f7fd75532a5e 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_incompatible_module_with_changed_param.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_incompatible_module_with_changed_param.exp @@ -1,2 +1,2 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0200000006010002030205050703070a04080e100c1e0700000001000100010300014d01663eebd722df1633f4bf38f1e2087222e90001000001010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0300000006010002030205050703070a04080e100c1e0700000001000100010300014d01663eebd722df1633f4bf38f1e2087222e90001000001010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90400000000000000))] }), events: [], gas_used: 1, status: Keep(MISCELLANEOUS_ERROR) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_incompatible_module_with_removed_pub_fn.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_incompatible_module_with_removed_pub_fn.exp index 12559f6cec10..e37bc05366bb 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_incompatible_module_with_removed_pub_fn.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__linking_incompatible_module_with_removed_pub_fn.exp @@ -1,2 +1,2 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0200000006010002030205050701070804080c100c1c070000000100000000014d01663eebd722df1633f4bf38f1e2087222e90001000000010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b0300000006010002030205050701070804080c100c1c070000000100000000014d01663eebd722df1633f4bf38f1e2087222e90001000000010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90400000000000000))] }), events: [], gas_used: 1, status: Keep(MISCELLANEOUS_ERROR) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__test_publishing_allow_modules.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__test_publishing_allow_modules.exp index 0ab276225c7f..3b45e2f9f343 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__test_publishing_allow_modules.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__test_publishing_allow_modules.exp @@ -1 +1 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90b00000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b02000000030100020702020804100000014d3eebd722df1633f4bf38f1e2087222e900))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90b00000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b03000000030100020702020804100000014d3eebd722df1633f4bf38f1e2087222e900))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__test_publishing_no_modules_non_allowlist_script_proper_sender.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__test_publishing_no_modules_non_allowlist_script_proper_sender.exp index d208e873a506..7f3af6e791f7 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__test_publishing_no_modules_non_allowlist_script_proper_sender.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__test_publishing_no_modules_non_allowlist_script_proper_sender.exp @@ -1 +1 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 00000000000000000000000000000001, path: 0000000000000000000000000000000001014d }, Value(a11ceb0b02000000030100020702020804100000014d0000000000000000000000000000000100)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(20872d108c30648f16843e29655b181edc12dcc9318ec7d90d98a52801cdcd96c9010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 00000000000000000000000000000001, path: 0000000000000000000000000000000001014d }, Value(a11ceb0b03000000030100020702020804100000014d0000000000000000000000000000000100)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(20872d108c30648f16843e29655b181edc12dcc9318ec7d90d98a52801cdcd96c9010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__test_publishing_no_modules_proper_sender.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__test_publishing_no_modules_proper_sender.exp index d208e873a506..7f3af6e791f7 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__test_publishing_no_modules_proper_sender.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__module_publishing__test_publishing_no_modules_proper_sender.exp @@ -1 +1 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 00000000000000000000000000000001, path: 0000000000000000000000000000000001014d }, Value(a11ceb0b02000000030100020702020804100000014d0000000000000000000000000000000100)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(20872d108c30648f16843e29655b181edc12dcc9318ec7d90d98a52801cdcd96c9010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 00000000000000000000000000000001, path: 0000000000000000000000000000000001014d }, Value(a11ceb0b03000000030100020702020804100000014d0000000000000000000000000000000100)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(20872d108c30648f16843e29655b181edc12dcc9318ec7d90d98a52801cdcd96c9010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__script_functions__script_fn_payload_invoke_private_fn.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__script_functions__script_fn_payload_invoke_private_fn.exp index 49ec5f066947..5480158a6399 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__script_functions__script_fn_payload_invoke_private_fn.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__script_functions__script_fn_payload_invoke_private_fn.exp @@ -1,4 +1,4 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b020000000601000203020f05110607171e0835100c4515000000010001000002000100000302010001060c00010c014d09665f7072697661746508665f7075626c696308665f7363726970743eebd722df1633f4bf38f1e2087222e900000000010102010100000101020202000001010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b030000000601000203020f05110607171e0835100c4515000000010001000002000100000302010001060c00010c014d09665f7072697661746508665f7075626c696308665f7363726970743eebd722df1633f4bf38f1e2087222e900000000010102010100000101020202000001010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [] }), events: [], gas_used: 0, status: Discard(FEATURE_UNDER_GATING) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e6669670107000000000000000000000000000000011f4469656d5472616e73616374696f6e5075626c697368696e674f7074696f6e1f4469656d5472616e73616374696f6e5075626c697368696e674f7074696f6e00 }, Value(0000))] }), events: [], gas_used: 127, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180300000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e6669670107000000000000000000000000000000010b4469656d56657273696f6e0b4469656d56657273696f6e00 }, Value(0200000000000000))] }), events: [], gas_used: 166, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__script_functions__script_fn_payload_invoke_public_fn.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__script_functions__script_fn_payload_invoke_public_fn.exp index 49ec5f066947..5480158a6399 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__script_functions__script_fn_payload_invoke_public_fn.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__script_functions__script_fn_payload_invoke_public_fn.exp @@ -1,4 +1,4 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b020000000601000203020f05110607171e0835100c4515000000010001000002000100000302010001060c00010c014d09665f7072697661746508665f7075626c696308665f7363726970743eebd722df1633f4bf38f1e2087222e900000000010102010100000101020202000001010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b030000000601000203020f05110607171e0835100c4515000000010001000002000100000302010001060c00010c014d09665f7072697661746508665f7075626c696308665f7363726970743eebd722df1633f4bf38f1e2087222e900000000010102010100000101020202000001010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [] }), events: [], gas_used: 0, status: Discard(FEATURE_UNDER_GATING) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e6669670107000000000000000000000000000000011f4469656d5472616e73616374696f6e5075626c697368696e674f7074696f6e1f4469656d5472616e73616374696f6e5075626c697368696e674f7074696f6e00 }, Value(0000))] }), events: [], gas_used: 127, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180300000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e6669670107000000000000000000000000000000010b4469656d56657273696f6e0b4469656d56657273696f6e00 }, Value(0200000000000000))] }), events: [], gas_used: 166, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__script_functions__script_fn_payload_invoke_script_fn.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__script_functions__script_fn_payload_invoke_script_fn.exp index 5c8005e79d63..956a50082d39 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__script_functions__script_fn_payload_invoke_script_fn.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__script_functions__script_fn_payload_invoke_script_fn.exp @@ -1,4 +1,4 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b020000000601000203020f05110607171e0835100c4515000000010001000002000100000302010001060c00010c014d09665f7072697661746508665f7075626c696308665f7363726970743eebd722df1633f4bf38f1e2087222e900000000010102010100000101020202000001010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90300000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b030000000601000203020f05110607171e0835100c4515000000010001000002000100000302010001060c00010c014d09665f7072697661746508665f7075626c696308665f7363726970743eebd722df1633f4bf38f1e2087222e900000000010102010100000101020202000001010200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [] }), events: [], gas_used: 0, status: Discard(FEATURE_UNDER_GATING) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e6669670107000000000000000000000000000000011f4469656d5472616e73616374696f6e5075626c697368696e674f7074696f6e1f4469656d5472616e73616374696f6e5075626c697368696e674f7074696f6e00 }, Value(0000))] }), events: [], gas_used: 127, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180300000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e6669670107000000000000000000000000000000010b4469656d56657273696f6e0b4469656d56657273696f6e00 }, Value(0200000000000000))] }), events: [], gas_used: 166, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__transaction_builder__add_child_currencies_version_1.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__transaction_builder__add_child_currencies_version_1.exp index cc1c73b097f0..6b82745fd334 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__transaction_builder__add_child_currencies_version_1.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__transaction_builder__add_child_currencies_version_1.exp @@ -1,6 +1,6 @@ Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e6669670107000000000000000000000000000000011f4469656d5472616e73616374696f6e5075626c697368696e674f7074696f6e1f4469656d5472616e73616374696f6e5075626c697368696e674f7074696f6e00 }, Value(0000))] }), events: [], gas_used: 127, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 0100000000000000000000000000000001094469656d426c6f636b0d426c6f636b4d6574616461746100 }, Value(010000000000000001000000000000001811000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010d4469656d54696d657374616d701743757272656e7454696d654d6963726f7365636f6e647300 }, Value(0100000000000000))] }), events: [ContractEvent { key: EventKey(11000000000000000000000000000000000000000a550c18), index: 0, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemBlock"), name: Identifier("NewBlockEvent"), type_params: [] }), event_data: "000000000000000051c1b9fc2f32d6f2fff669823ef31cbe000100000000000000" }], gas_used: 100000000, status: Keep(EXECUTED) }]) -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 00000000000000000000000000000001, path: 000000000000000000000000000000000104434f494e }, Value(a11ceb0b020000000a010006020608030e10041e0205201a073a4908830110069301080a9b01050ca00135000000010002000004000202070000030001000205020300010605010104020402060c060c0002030301080101080006060c060c080103030a0204434f494e044469656d0c4669786564506f696e74333204696e69740178146372656174655f66726f6d5f726174696f6e616c1572656769737465725f5343535f63757272656e6379000000000000000000000000000000010a020504434f494e000201040100010000010a0b000b01060100000000000000060100000000000000110106640000000000000006e803000000000000070038000200)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180300000000000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 00000000000000000000000000000001, path: 000000000000000000000000000000000104434f494e }, Value(a11ceb0b030000000a010006020608030e10041e0205201a073a4908830110069301080a9b01050ca00135000000010002000004000202070000030001000205020300010605010104020402060c060c0002030301080101080006060c060c080103030a0204434f494e044469656d0c4669786564506f696e74333204696e69740178146372656174655f66726f6d5f726174696f6e616c1572656769737465725f5343535f63757272656e6379000000000000000000000000000000010a020504434f494e000201040100010000010a0b000b01060100000000000000060100000000000000110106640000000000000006e803000000000000070038000200)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180300000000000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180400000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e74134469656d57726974655365744d616e6167657200 }, Value(01000000000000001801000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 0100000000000000000000000000000001044469656d0c43757272656e6379496e666f01070000000000000000000000000000000104434f494e04434f494e00 }, Value(0000000000000000000000000000000000000000000000000000000001000000006400000000000000e80300000000000004434f494e0100000000000000001812000000000000000000000000000000000000000a550c1800000000000000001813000000000000000000000000000000000000000a550c1800000000000000001814000000000000000000000000000000000000000a550c1800000000000000001815000000000000000000000000000000000000000a550c1800000000000000001816000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670d436f6e66696775726174696f6e00 }, Value(0200000000000000010000000000000002000000000000001804000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e666967010700000000000000000000000000000001145265676973746572656443757272656e63696573145265676973746572656443757272656e6369657300 }, Value(03035855530358445804434f494e)), (AccessPath { address: 0000000000000000000000000a550c18, path: 0100000000000000000000000000000001054576656e74144576656e7448616e646c6547656e657261746f7200 }, Value(17000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000b1e55ed, path: 0100000000000000000000000000000001044469656d0e4275726e4361706162696c69747901070000000000000000000000000000000104434f494e04434f494e00 }, Value(00)), (AccessPath { address: 0000000000000000000000000b1e55ed, path: 0100000000000000000000000000000001044469656d0e4d696e744361706162696c69747901070000000000000000000000000000000104434f494e04434f494e00 }, Value(00))] }), events: [ContractEvent { key: EventKey(04000000000000000000000000000000000000000a550c18), index: 1, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemConfig"), name: Identifier("NewEpochEvent"), type_params: [] }), event_data: "0200000000000000" }, ContractEvent { key: EventKey(01000000000000000000000000000000000000000a550c18), index: 0, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemAccount"), name: Identifier("AdminTransactionEvent"), type_params: [] }), event_data: "0000000000000000" }], gas_used: 0, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 0100000000000000000000000000000001094469656d426c6f636b0d426c6f636b4d6574616461746100 }, Value(020000000000000002000000000000001811000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010d4469656d54696d657374616d701743757272656e7454696d654d6963726f7365636f6e647300 }, Value(0200000000000000))] }), events: [ContractEvent { key: EventKey(11000000000000000000000000000000000000000a550c18), index: 1, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemBlock"), name: Identifier("NewBlockEvent"), type_params: [] }), event_data: "000000000000000051c1b9fc2f32d6f2fff669823ef31cbe000200000000000000" }], gas_used: 100000000, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e741b4163636f756e744f7065726174696f6e734361706162696c69747900 }, Value(0018000000000000001800000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000b1e55ed, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000b1e55ed010000000000000000000000000b1e55ed00000000000000001800000000000000000000000000000000000000000b1e55ed00000000000000001801000000000000000000000000000000000000000b1e55ed0100000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010f4163636f756e74467265657a696e670b467265657a696e6742697400 }, Value(00)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740742616c616e6365010700000000000000000000000000000001035855530358555300 }, Value(0000000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001802000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001803000000000000003eebd722df1633f4bf38f1e2087222e90000000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010f4475616c4174746573746174696f6e0a43726564656e7469616c00 }, Value(000000ffffffffffffffff00000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001801000000000000003eebd722df1633f4bf38f1e2087222e9)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 0100000000000000000000000000000001054576656e74144576656e7448616e646c6547656e657261746f7200 }, Value(04000000000000003eebd722df1633f4bf38f1e2087222e9)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 010000000000000000000000000000000105526f6c657306526f6c65496400 }, Value(0500000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 010000000000000000000000000000000104564153500a506172656e745641535000 }, Value(0000000000000000))] }), events: [ContractEvent { key: EventKey(00000000000000000000000000000000000000000a550c18), index: 23, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemAccount"), name: Identifier("CreateAccountEvent"), type_params: [] }), event_data: "3eebd722df1633f4bf38f1e2087222e90500000000000000" }], gas_used: 1684, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__transaction_builder__add_child_currencies_version_2.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__transaction_builder__add_child_currencies_version_2.exp index 432b69a5cabc..af6e1f091078 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__transaction_builder__add_child_currencies_version_2.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__transaction_builder__add_child_currencies_version_2.exp @@ -1,6 +1,6 @@ Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180300000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e6669670107000000000000000000000000000000011f4469656d5472616e73616374696f6e5075626c697368696e674f7074696f6e1f4469656d5472616e73616374696f6e5075626c697368696e674f7074696f6e00 }, Value(0000))] }), events: [], gas_used: 127, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 0100000000000000000000000000000001094469656d426c6f636b0d426c6f636b4d6574616461746100 }, Value(010000000000000001000000000000001811000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010d4469656d54696d657374616d701743757272656e7454696d654d6963726f7365636f6e647300 }, Value(0100000000000000))] }), events: [ContractEvent { key: EventKey(11000000000000000000000000000000000000000a550c18), index: 0, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemBlock"), name: Identifier("NewBlockEvent"), type_params: [] }), event_data: "000000000000000051c1b9fc2f32d6f2fff669823ef31cbe000100000000000000" }], gas_used: 100000000, status: Keep(EXECUTED) }]) -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 00000000000000000000000000000001, path: 000000000000000000000000000000000104434f494e }, Value(a11ceb0b020000000a010006020608030e10041e0205201a073a4908830110069301080a9b01050ca00135000000010002000004000202070000030001000205020300010605010104020402060c060c0002030301080101080006060c060c080103030a0204434f494e044469656d0c4669786564506f696e74333204696e69740178146372656174655f66726f6d5f726174696f6e616c1572656769737465725f5343535f63757272656e6379000000000000000000000000000000010a020504434f494e000201040100010000010a0b000b01060100000000000000060100000000000000110106640000000000000006e803000000000000070038000200)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180400000000000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 00000000000000000000000000000001, path: 000000000000000000000000000000000104434f494e }, Value(a11ceb0b030000000a010006020608030e10041e0205201a073a4908830110069301080a9b01050ca00135000000010002000004000202070000030001000205020300010605010104020402060c060c0002030301080101080006060c060c080103030a0204434f494e044469656d0c4669786564506f696e74333204696e69740178146372656174655f66726f6d5f726174696f6e616c1572656769737465725f5343535f63757272656e6379000000000000000000000000000000010a020504434f494e000201040100010000010a0b000b01060100000000000000060100000000000000110106640000000000000006e803000000000000070038000200)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180400000000000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180500000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e74134469656d57726974655365744d616e6167657200 }, Value(02000000000000001801000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 0100000000000000000000000000000001044469656d0c43757272656e6379496e666f01070000000000000000000000000000000104434f494e04434f494e00 }, Value(0000000000000000000000000000000000000000000000000000000001000000006400000000000000e80300000000000004434f494e0100000000000000001812000000000000000000000000000000000000000a550c1800000000000000001813000000000000000000000000000000000000000a550c1800000000000000001814000000000000000000000000000000000000000a550c1800000000000000001815000000000000000000000000000000000000000a550c1800000000000000001816000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670d436f6e66696775726174696f6e00 }, Value(0200000000000000010000000000000002000000000000001804000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e666967010700000000000000000000000000000001145265676973746572656443757272656e63696573145265676973746572656443757272656e6369657300 }, Value(03035855530358445804434f494e)), (AccessPath { address: 0000000000000000000000000a550c18, path: 0100000000000000000000000000000001054576656e74144576656e7448616e646c6547656e657261746f7200 }, Value(17000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000b1e55ed, path: 0100000000000000000000000000000001044469656d0e4275726e4361706162696c69747901070000000000000000000000000000000104434f494e04434f494e00 }, Value(00)), (AccessPath { address: 0000000000000000000000000b1e55ed, path: 0100000000000000000000000000000001044469656d0e4d696e744361706162696c69747901070000000000000000000000000000000104434f494e04434f494e00 }, Value(00))] }), events: [ContractEvent { key: EventKey(04000000000000000000000000000000000000000a550c18), index: 1, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemConfig"), name: Identifier("NewEpochEvent"), type_params: [] }), event_data: "0200000000000000" }, ContractEvent { key: EventKey(01000000000000000000000000000000000000000a550c18), index: 1, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemAccount"), name: Identifier("AdminTransactionEvent"), type_params: [] }), event_data: "0000000000000000" }], gas_used: 0, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 0100000000000000000000000000000001094469656d426c6f636b0d426c6f636b4d6574616461746100 }, Value(020000000000000002000000000000001811000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010d4469656d54696d657374616d701743757272656e7454696d654d6963726f7365636f6e647300 }, Value(0200000000000000))] }), events: [ContractEvent { key: EventKey(11000000000000000000000000000000000000000a550c18), index: 1, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemBlock"), name: Identifier("NewBlockEvent"), type_params: [] }), event_data: "000000000000000051c1b9fc2f32d6f2fff669823ef31cbe000200000000000000" }], gas_used: 100000000, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e741b4163636f756e744f7065726174696f6e734361706162696c69747900 }, Value(0018000000000000001800000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000b1e55ed, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000b1e55ed010000000000000000000000000b1e55ed00000000000000001800000000000000000000000000000000000000000b1e55ed00000000000000001801000000000000000000000000000000000000000b1e55ed0100000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010f4163636f756e74467265657a696e670b467265657a696e6742697400 }, Value(00)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740742616c616e6365010700000000000000000000000000000001035855530358555300 }, Value(0000000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001802000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001803000000000000003eebd722df1633f4bf38f1e2087222e90000000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010f4475616c4174746573746174696f6e0a43726564656e7469616c00 }, Value(000000ffffffffffffffff00000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001801000000000000003eebd722df1633f4bf38f1e2087222e9)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 0100000000000000000000000000000001054576656e74144576656e7448616e646c6547656e657261746f7200 }, Value(04000000000000003eebd722df1633f4bf38f1e2087222e9)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 010000000000000000000000000000000105526f6c657306526f6c65496400 }, Value(0500000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 010000000000000000000000000000000104564153500a506172656e745641535000 }, Value(0000000000000000))] }), events: [ContractEvent { key: EventKey(00000000000000000000000000000000000000000a550c18), index: 23, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemAccount"), name: Identifier("CreateAccountEvent"), type_params: [] }), event_data: "3eebd722df1633f4bf38f1e2087222e90500000000000000" }], gas_used: 1684, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__publish_and_register_new_currency.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__publish_and_register_new_currency.exp index 99a732032518..4e4b3ab12c48 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__publish_and_register_new_currency.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__publish_and_register_new_currency.exp @@ -1,4 +1,4 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 00000000000000000000000000000001, path: 000000000000000000000000000000000104434f494e }, Value(a11ceb0b020000000a010006020608030e10041e0205201a073a4f08890110069901080aa101050ca60135000000010002000004000101070000030001000105020300020605010104020402060c060c0002030301080101080006060c060c080103030a0204434f494e0c4669786564506f696e743332044469656d0a696e697469616c697a650178146372656174655f66726f6d5f726174696f6e616c1572656769737465725f5343535f63757272656e6379000000000000000000000000000000010a020504434f494e000201040100010000010a0b000b01060100000000000000060200000000000000110106a086010000000000066400000000000000070038000200)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(20872d108c30648f16843e29655b181edc12dcc9318ec7d90d98a52801cdcd96c9010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 00000000000000000000000000000001, path: 000000000000000000000000000000000104434f494e }, Value(a11ceb0b030000000a010006020608030e10041e0205201a073a4f08890110069901080aa101050ca60135000000010002000004000101070000030001000105020300020605010104020402060c060c0002030301080101080006060c060c080103030a0204434f494e0c4669786564506f696e743332044469656d0a696e697469616c697a650178146372656174655f66726f6d5f726174696f6e616c1572656769737465725f5343535f63757272656e6379000000000000000000000000000000010a020504434f494e000201040100010000010a0b000b01060100000000000000060200000000000000110106a086010000000000066400000000000000070038000200)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(20872d108c30648f16843e29655b181edc12dcc9318ec7d90d98a52801cdcd96c9010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 0100000000000000000000000000000001094469656d426c6f636b0d426c6f636b4d6574616461746100 }, Value(010000000000000001000000000000001811000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010d4469656d54696d657374616d701743757272656e7454696d654d6963726f7365636f6e647300 }, Value(0100000000000000))] }), events: [ContractEvent { key: EventKey(11000000000000000000000000000000000000000a550c18), index: 0, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemBlock"), name: Identifier("NewBlockEvent"), type_params: [] }), event_data: "000000000000000051c1b9fc2f32d6f2fff669823ef31cbe000100000000000000" }], gas_used: 100000000, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(20872d108c30648f16843e29655b181edc12dcc9318ec7d90d98a52801cdcd96c9010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180300000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e74134469656d57726974655365744d616e6167657200 }, Value(01000000000000001801000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 0100000000000000000000000000000001044469656d0c43757272656e6379496e666f01070000000000000000000000000000000104434f494e04434f494e00 }, Value(000000000000000000000000000000000000000000000000000000800000000000a086010000000000640000000000000004434f494e0100000000000000001812000000000000000000000000000000000000000a550c1800000000000000001813000000000000000000000000000000000000000a550c1800000000000000001814000000000000000000000000000000000000000a550c1800000000000000001815000000000000000000000000000000000000000a550c1800000000000000001816000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670d436f6e66696775726174696f6e00 }, Value(0200000000000000010000000000000002000000000000001804000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e666967010700000000000000000000000000000001145265676973746572656443757272656e63696573145265676973746572656443757272656e6369657300 }, Value(03035855530358445804434f494e)), (AccessPath { address: 0000000000000000000000000a550c18, path: 0100000000000000000000000000000001054576656e74144576656e7448616e646c6547656e657261746f7200 }, Value(17000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000b1e55ed, path: 0100000000000000000000000000000001044469656d0e4275726e4361706162696c69747901070000000000000000000000000000000104434f494e04434f494e00 }, Value(00)), (AccessPath { address: 0000000000000000000000000b1e55ed, path: 0100000000000000000000000000000001044469656d0e4d696e744361706162696c69747901070000000000000000000000000000000104434f494e04434f494e00 }, Value(00))] }), events: [ContractEvent { key: EventKey(04000000000000000000000000000000000000000a550c18), index: 1, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemConfig"), name: Identifier("NewEpochEvent"), type_params: [] }), event_data: "0200000000000000" }, ContractEvent { key: EventKey(01000000000000000000000000000000000000000a550c18), index: 0, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemAccount"), name: Identifier("AdminTransactionEvent"), type_params: [] }), event_data: "0000000000000000" }], gas_used: 0, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e741b4163636f756e744f7065726174696f6e734361706162696c69747900 }, Value(0018000000000000001800000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000b1e55ed, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(20872d108c30648f16843e29655b181edc12dcc9318ec7d90d98a52801cdcd96c9010000000000000000000000000b1e55ed010000000000000000000000000b1e55ed00000000000000001801000000000000000000000000000000000000000b1e55ed00000000000000001802000000000000000000000000000000000000000b1e55ed0100000000000000)), (AccessPath { address: c5e34b925cf6875fec02d4b77adbd2d6, path: 01000000000000000000000000000000010f4163636f756e74467265657a696e670b467265657a696e6742697400 }, Value(00)), (AccessPath { address: c5e34b925cf6875fec02d4b77adbd2d6, path: 01000000000000000000000000000000011044657369676e617465644465616c6572064465616c657200 }, Value(0000000000000000180000000000000000c5e34b925cf6875fec02d4b77adbd2d6)), (AccessPath { address: c5e34b925cf6875fec02d4b77adbd2d6, path: 0100000000000000000000000000000001044469656d0c5072656275726e5175657565010700000000000000000000000000000001035855530358555300 }, Value(00)), (AccessPath { address: c5e34b925cf6875fec02d4b77adbd2d6, path: 01000000000000000000000000000000010b4469656d4163636f756e740742616c616e636501070000000000000000000000000000000104434f494e04434f494e00 }, Value(0000000000000000)), (AccessPath { address: c5e34b925cf6875fec02d4b77adbd2d6, path: 01000000000000000000000000000000010b4469656d4163636f756e740742616c616e6365010700000000000000000000000000000001035844580358445800 }, Value(0000000000000000)), (AccessPath { address: c5e34b925cf6875fec02d4b77adbd2d6, path: 01000000000000000000000000000000010b4469656d4163636f756e740742616c616e6365010700000000000000000000000000000001035855530358555300 }, Value(0000000000000000)), (AccessPath { address: c5e34b925cf6875fec02d4b77adbd2d6, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(207deeccb1080854f499ec8b4c1b213b82c5e34b925cf6875fec02d4b77adbd2d601c5e34b925cf6875fec02d4b77adbd2d601c5e34b925cf6875fec02d4b77adbd2d60000000000000000180300000000000000c5e34b925cf6875fec02d4b77adbd2d60000000000000000180400000000000000c5e34b925cf6875fec02d4b77adbd2d60000000000000000)), (AccessPath { address: c5e34b925cf6875fec02d4b77adbd2d6, path: 01000000000000000000000000000000010f4475616c4174746573746174696f6e0a43726564656e7469616c00 }, Value(000000ffffffffffffffff0000000000000000180100000000000000c5e34b925cf6875fec02d4b77adbd2d60000000000000000180200000000000000c5e34b925cf6875fec02d4b77adbd2d6)), (AccessPath { address: c5e34b925cf6875fec02d4b77adbd2d6, path: 0100000000000000000000000000000001054576656e74144576656e7448616e646c6547656e657261746f7200 }, Value(0500000000000000c5e34b925cf6875fec02d4b77adbd2d6)), (AccessPath { address: c5e34b925cf6875fec02d4b77adbd2d6, path: 010000000000000000000000000000000105526f6c657306526f6c65496400 }, Value(0200000000000000))] }), events: [ContractEvent { key: EventKey(00000000000000000000000000000000000000000a550c18), index: 23, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemAccount"), name: Identifier("CreateAccountEvent"), type_params: [] }), event_data: "c5e34b925cf6875fec02d4b77adbd2d60200000000000000" }], gas_used: 2409, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_no_publishing_diem_root_sender.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_no_publishing_diem_root_sender.exp index 3f68f7544f0f..a3fd1ff2a8a7 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_no_publishing_diem_root_sender.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_no_publishing_diem_root_sender.exp @@ -1 +1 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 00000000000000000000000000000001, path: 0000000000000000000000000000000001014d }, Value(a11ceb0b020000000601000203020a050c0607120a081c100c2c2d000000010001000002000100020303010300014d036d61780373756d0000000000000000000000000000000100010000020a0a000a012404060a00020a0102060000000000000000020101000001060a000a01160c020a020200)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(20872d108c30648f16843e29655b181edc12dcc9318ec7d90d98a52801cdcd96c9010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 00000000000000000000000000000001, path: 0000000000000000000000000000000001014d }, Value(a11ceb0b030000000601000203020a050c0607120a081c100c2c2d000000010001000002000100020303010300014d036d61780373756d0000000000000000000000000000000100010000020a0a000a012404060a00020a0102060000000000000000020101000001060a000a01160c020a020200)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(20872d108c30648f16843e29655b181edc12dcc9318ec7d90d98a52801cdcd96c9010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_open_publishing.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_open_publishing.exp index 52fc003df946..5f6230eee2d8 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_open_publishing.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_open_publishing.exp @@ -1 +1 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000b1e55ed, path: 01000000000000000000000000000000010e5472616e73616374696f6e4665650e5472616e73616374696f6e466565010700000000000000000000000000000001035855530358555300 }, Value(08000000000000000000000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740742616c616e6365010700000000000000000000000000000001035855530358555300 }, Value(38420f0000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90b00000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b020000000601000203020a050c0607120a081c100c2c2d000000010001000002000100020303010300014d036d61780373756d3eebd722df1633f4bf38f1e2087222e900010000020a0a000a012404060a00020a0102060000000000000000020101000001060a000a01160c020a020200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000b1e55ed, path: 01000000000000000000000000000000010e5472616e73616374696f6e4665650e5472616e73616374696f6e466565010700000000000000000000000000000001035855530358555300 }, Value(08000000000000000000000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740742616c616e6365010700000000000000000000000000000001035855530358555300 }, Value(38420f0000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201636331b85359efd8b9ba888caff7a063eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e9013eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e900000000000000001800000000000000003eebd722df1633f4bf38f1e2087222e90b00000000000000)), (AccessPath { address: 3eebd722df1633f4bf38f1e2087222e9, path: 003eebd722df1633f4bf38f1e2087222e9014d }, Value(a11ceb0b030000000601000203020a050c0607120a081c100c2c2d000000010001000002000100020303010300014d036d61780373756d3eebd722df1633f4bf38f1e2087222e900010000020a0a000a012404060a00020a0102060000000000000000020101000001060a000a01160c020a020200))] }), events: [], gas_used: 8, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__writeset_builder__build_upgrade_writeset_version_1.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__writeset_builder__build_upgrade_writeset_version_1.exp index 9ff076296cb4..b34ba8c1b8ef 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__writeset_builder__build_upgrade_writeset_version_1.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__writeset_builder__build_upgrade_writeset_version_1.exp @@ -1,2 +1,2 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e74134469656d57726974655365744d616e6167657200 }, Value(01000000000000001801000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e6669670107000000000000000000000000000000010b4469656d56657273696f6e0b4469656d56657273696f6e00 }, Value(0b00000000000000)), (AccessPath { address: 00000000000000000000000000000001, path: 0000000000000000000000000000000001014d }, Value(a11ceb0b0200000006010002030205050703070a080812100c221000000001000100000103014d056d6167696300000000000000000000000000000001000100000002062a000000000000000200))] }), events: [ContractEvent { key: EventKey(01000000000000000000000000000000000000000a550c18), index: 0, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemAccount"), name: Identifier("AdminTransactionEvent"), type_params: [] }), event_data: "0000000000000000" }], gas_used: 0, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180200000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e74134469656d57726974655365744d616e6167657200 }, Value(01000000000000001801000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e6669670107000000000000000000000000000000010b4469656d56657273696f6e0b4469656d56657273696f6e00 }, Value(0b00000000000000)), (AccessPath { address: 00000000000000000000000000000001, path: 0000000000000000000000000000000001014d }, Value(a11ceb0b0300000006010002030205050703070a080812100c221000000001000100000103014d056d6167696300000000000000000000000000000001000100000002062a000000000000000200))] }), events: [ContractEvent { key: EventKey(01000000000000000000000000000000000000000a550c18), index: 0, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemAccount"), name: Identifier("AdminTransactionEvent"), type_params: [] }), event_data: "0000000000000000" }], gas_used: 0, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180300000000000000))] }), events: [], gas_used: 12, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__writeset_builder__build_upgrade_writeset_version_2.exp b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__writeset_builder__build_upgrade_writeset_version_2.exp index e57f80461794..8f653c9357e3 100644 --- a/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__writeset_builder__build_upgrade_writeset_version_2.exp +++ b/language/testing-infra/e2e-tests/goldens/language_e2e_testsuite__tests__writeset_builder__build_upgrade_writeset_version_2.exp @@ -1,2 +1,2 @@ -Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180300000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e74134469656d57726974655365744d616e6167657200 }, Value(02000000000000001801000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e6669670107000000000000000000000000000000010b4469656d56657273696f6e0b4469656d56657273696f6e00 }, Value(0b00000000000000)), (AccessPath { address: 00000000000000000000000000000001, path: 0000000000000000000000000000000001014d }, Value(a11ceb0b0200000006010002030205050703070a080812100c221000000001000100000103014d056d6167696300000000000000000000000000000001000100000002062a000000000000000200))] }), events: [ContractEvent { key: EventKey(01000000000000000000000000000000000000000a550c18), index: 1, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemAccount"), name: Identifier("AdminTransactionEvent"), type_params: [] }), event_data: "0000000000000000" }], gas_used: 0, status: Keep(EXECUTED) }]) +Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180300000000000000)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e74134469656d57726974655365744d616e6167657200 }, Value(02000000000000001801000000000000000000000000000000000000000a550c18)), (AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010a4469656d436f6e6669670a4469656d436f6e6669670107000000000000000000000000000000010b4469656d56657273696f6e0b4469656d56657273696f6e00 }, Value(0b00000000000000)), (AccessPath { address: 00000000000000000000000000000001, path: 0000000000000000000000000000000001014d }, Value(a11ceb0b0300000006010002030205050703070a080812100c221000000001000100000103014d056d6167696300000000000000000000000000000001000100000002062a000000000000000200))] }), events: [ContractEvent { key: EventKey(01000000000000000000000000000000000000000a550c18), index: 1, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemAccount"), name: Identifier("AdminTransactionEvent"), type_params: [] }), event_data: "0000000000000000" }], gas_used: 0, status: Keep(EXECUTED) }]) Ok([TransactionOutput { write_set: WriteSet(WriteSetMut { write_set: [(AccessPath { address: 0000000000000000000000000a550c18, path: 01000000000000000000000000000000010b4469656d4163636f756e740b4469656d4163636f756e7400 }, Value(201304972f9242cbc3528a1e286323471ab891baa37e0053b85651693a79854a00010000000000000000000000000a550c18010000000000000000000000000a550c1800000000000000001802000000000000000000000000000000000000000a550c1800000000000000001803000000000000000000000000000000000000000a550c180400000000000000))] }), events: [], gas_used: 12, status: Keep(EXECUTED) }]) diff --git a/language/testing-infra/test-generation/src/lib.rs b/language/testing-infra/test-generation/src/lib.rs index c867bd0d4f68..35bd1def02d4 100644 --- a/language/testing-infra/test-generation/src/lib.rs +++ b/language/testing-infra/test-generation/src/lib.rs @@ -409,8 +409,10 @@ pub fn abilities( TypeParameter(idx) => constraints[*idx as usize], Vector(ty) => AbilitySet::polymorphic_abilities( AbilitySet::VECTOR, - vec![abilities(module, ty, constraints)].into_iter(), - ), + vec![false], + vec![abilities(module, ty, constraints)], + ) + .unwrap(), Struct(idx) => { let sh = module.struct_handle_at(*idx); sh.abilities @@ -418,10 +420,17 @@ pub fn abilities( StructInstantiation(idx, type_args) => { let sh = module.struct_handle_at(*idx); let declared_abilities = sh.abilities; - let type_argument_abilities = type_args + let declared_phantom_parameters = + sh.type_parameters.iter().map(|param| param.is_phantom); + let type_arguments = type_args .iter() - .map(|ty| abilities(module, ty, constraints)); - AbilitySet::polymorphic_abilities(declared_abilities, type_argument_abilities) + .map(|arg| abilities(module, arg, constraints)); + AbilitySet::polymorphic_abilities( + declared_abilities, + declared_phantom_parameters, + type_arguments, + ) + .unwrap() } } } diff --git a/language/testing-infra/test-generation/src/transitions.rs b/language/testing-infra/test-generation/src/transitions.rs index f7141c127636..8d6c8676ff6d 100644 --- a/language/testing-infra/test-generation/src/transitions.rs +++ b/language/testing-infra/test-generation/src/transitions.rs @@ -390,7 +390,7 @@ pub fn stack_satisfies_struct_signature( token_view.as_inner().clone() }; let has = if let SignatureToken::TypeParameter(idx) = &ty { - if stack_has_all_abilities(state, i, type_parameters[*idx as usize]) { + if stack_has_all_abilities(state, i, type_parameters[*idx as usize].constraints) { let stack_tok = state.stack_peek(i).unwrap(); substitution.check_and_add(state, stack_tok.token, ty) } else { @@ -399,7 +399,14 @@ pub fn stack_satisfies_struct_signature( } else { let abstract_value = AbstractValue { token: ty, - abilities: abilities(&state.module.module, token_view.as_inner(), type_parameters), + abilities: abilities( + &state.module.module, + token_view.as_inner(), + &type_parameters + .iter() + .map(|param| param.constraints) + .collect::>(), + ), }; stack_has(state, i, Some(abstract_value)) }; @@ -431,9 +438,9 @@ pub fn get_struct_instantiation_for_state( let struct_def = state.module.module.struct_def_at(struct_index); let struct_def = StructDefinitionView::new(&state.module.module, struct_def); let typs = struct_def.type_parameters(); - for (index, abilities) in typs.iter().enumerate() { + for (index, type_param) in typs.iter().enumerate() { if !partial_instantiation.subst.contains_key(&index) { - if abilities.has_key() { + if type_param.constraints.has_key() { unimplemented!("[Struct Instantiation] Need to fill in resource type params"); } else { partial_instantiation @@ -483,8 +490,17 @@ pub fn struct_abilities( .module .module .struct_handle_at(struct_def.struct_handle); + let declared_phantom_parameters = struct_handle + .type_parameters + .iter() + .map(|param| param.is_phantom); let type_argument_abilities = abilities_for_instantiation(state, &type_args.0); - AbilitySet::polymorphic_abilities(struct_handle.abilities, type_argument_abilities) + AbilitySet::polymorphic_abilities( + struct_handle.abilities, + declared_phantom_parameters, + type_argument_abilities, + ) + .unwrap() } pub fn struct_inst_abilities( diff --git a/language/testing-infra/test-generation/tests/struct_instructions.rs b/language/testing-infra/test-generation/tests/struct_instructions.rs index 320e416f5769..7e092ca01007 100644 --- a/language/testing-infra/test-generation/tests/struct_instructions.rs +++ b/language/testing-infra/test-generation/tests/struct_instructions.rs @@ -68,8 +68,15 @@ fn create_struct_value(module: &CompiledModule) -> (AbstractValue, Vec Disassembler<'a, Location> { Ok(instrs) } - fn disassemble_type_formals( + fn disassemble_struct_type_formals( + source_map_ty_params: &[SourceName], + type_parameters: &[StructTypeParameter], + ) -> String { + let ty_params: Vec = source_map_ty_params + .iter() + .zip(type_parameters) + .map(|((name, _), ty_param)| { + let abilities_str = if ty_param.constraints == AbilitySet::EMPTY { + "".to_string() + } else { + let ability_vec: Vec<_> = ty_param + .constraints + .into_iter() + .map(Self::format_ability) + .collect(); + format!(": {}", ability_vec.join(" + ")) + }; + format!( + "{}{}{}", + if ty_param.is_phantom { "phantom " } else { "" }, + name.as_str(), + abilities_str + ) + }) + .collect(); + Self::format_type_params(&ty_params) + } + + fn disassemble_fun_type_formals( source_map_ty_params: &[SourceName], ablities: &[AbilitySet], ) -> String { @@ -916,7 +946,7 @@ impl<'a, Location: Clone + Eq> Disassembler<'a, Location> { "" }; - let ty_params = Self::disassemble_type_formals( + let ty_params = Self::disassemble_fun_type_formals( &function_source_map.type_parameters, &function_handle.type_parameters, ); @@ -1029,7 +1059,7 @@ impl<'a, Location: Clone + Eq> Disassembler<'a, Location> { .identifier_at(struct_handle.name) .to_string(); - let ty_params = Self::disassemble_type_formals( + let ty_params = Self::disassemble_struct_type_formals( &struct_source_map.type_parameters, &struct_handle.type_parameters, ); diff --git a/language/tools/move-cli/tests/testsuite/events_emit_view/args.exp b/language/tools/move-cli/tests/testsuite/events_emit_view/args.exp index ac12d89869e9..c48cc5dfdf58 100644 --- a/language/tools/move-cli/tests/testsuite/events_emit_view/args.exp +++ b/language/tools/move-cli/tests/testsuite/events_emit_view/args.exp @@ -1,8 +1,8 @@ Command `sandbox publish src/modules -v`: Compiling Move modules... Found and compiled 1 modules -Publishing a new module 00000000000000000000000000000002::Events (wrote 368 bytes) -Wrote 368 bytes of module ID's and code +Publishing a new module 00000000000000000000000000000002::Events (wrote 369 bytes) +Wrote 369 bytes of module ID's and code Command `sandbox run src/scripts/emit.move --signers 0xA --args 5 -v`: Compiling transaction script... Emitted 1 events: