From d77e8bb20bf6a89a564b1d97ff9d4ef14e6918cf Mon Sep 17 00:00:00 2001 From: iorveth Date: Wed, 22 Jul 2020 20:01:05 +0000 Subject: [PATCH] Remove wrong uniqueness feature implementation --- runtime-modules/content-directory/src/lib.rs | 61 +--- .../content-directory/src/schema.rs | 23 -- .../src/tests/add_schema_support_to_entity.rs | 180 ++++++------ .../tests/insert_at_entity_property_vector.rs | 1 + .../src/tests/transfer_entity_ownership.rs | 272 +++++++++--------- .../tests/update_entity_property_values.rs | 164 +++++------ 6 files changed, 312 insertions(+), 389 deletions(-) diff --git a/runtime-modules/content-directory/src/lib.rs b/runtime-modules/content-directory/src/lib.rs index 4f9b286a1e..a283894cd2 100755 --- a/runtime-modules/content-directory/src/lib.rs +++ b/runtime-modules/content-directory/src/lib.rs @@ -736,24 +736,10 @@ decl_module! { // Make updated entity_property_values from parameters provided let entity_property_values_updated = - if let Some(entity_property_values_updated) = Self::make_updated_property_value_references_with_same_owner_flag_set( unused_property_id_references_with_same_owner_flag_set, &entity_property_values, &new_property_value_references_with_same_owner_flag_set, - ) { - - // Create wrapper structure from provided entity_property_values_updated - // and their corresponding Class properties - let updated_values_for_existing_properties = OutputValuesForExistingProperties::from( - &class_properties, &entity_property_values_updated - )?; - - // Traverse all updated_values_for_existing_properties to ensure unique option satisfied (if required) - Self::ensure_property_values_unique_option_satisfied(updated_values_for_existing_properties)?; - Some(entity_property_values_updated) - } else { - None - }; + ); // Transfer entity ownership let entities_inbound_rcs_delta = if let Some(entity_property_values_updated) = entity_property_values_updated { @@ -979,16 +965,6 @@ decl_module! { schema, entity_property_values, &new_output_property_values ); - // Create wrapper structure from updated entity values and their corresponding Class properties - let updated_values_for_existing_properties = OutputValuesForExistingProperties::from( - &class_properties, &entity_values_updated - )?; - - // Traverse all updated_values_for_existing_properties to ensure unique option satisfied (if required) - Self::ensure_property_values_unique_option_satisfied( - updated_values_for_existing_properties - )?; - // // == MUTATION SAFE == // @@ -1063,20 +1039,8 @@ decl_module! { let entity_property_values = entity.get_values(); // Make updated entity_property_values from current entity_property_values and new_property_values provided - let entity_property_values_updated = if let Some(entity_property_values_updated) = - Self::make_updated_property_values(&entity_property_values, &new_property_values) { - - // Create wrapper structure from new_property_values and their corresponding Class properties - let updated_values_for_existing_properties = OutputValuesForExistingProperties::from( - &class_properties, &entity_property_values_updated - )?; - - // Traverse all values_for_updated_properties to ensure unique option satisfied (if required) - Self::ensure_property_values_unique_option_satisfied(updated_values_for_existing_properties)?; - Some(entity_property_values_updated) - } else { - None - }; + let entity_property_values_updated = + Self::make_updated_property_values(&entity_property_values, &new_property_values); // If property values should be updated if let Some(entity_property_values_updated) = entity_property_values_updated { @@ -1863,25 +1827,6 @@ impl Module { Ok(()) } - /// Ensure all `updated_values_for_existing_properties` provided satisfy unique option, if required - pub fn ensure_property_values_unique_option_satisfied( - updated_values_for_existing_properties: OutputValuesForExistingProperties, - ) -> dispatch::Result { - for (&property_id, updated_value_for_existing_property) in - updated_values_for_existing_properties.iter() - { - let (property, value) = updated_value_for_existing_property.unzip(); - - // Ensure all InputPropertyValue's with unique option set are unique, except of null non required ones - property.ensure_unique_option_satisfied( - property_id, - value, - &updated_values_for_existing_properties, - )?; - } - Ok(()) - } - /// Validate all values, provided in `values_for_existing_properties`, against the type of its `Property` /// and check any additional constraints pub fn ensure_property_values_are_valid( diff --git a/runtime-modules/content-directory/src/schema.rs b/runtime-modules/content-directory/src/schema.rs index cecec57669..fa72cba745 100644 --- a/runtime-modules/content-directory/src/schema.rs +++ b/runtime-modules/content-directory/src/schema.rs @@ -330,29 +330,6 @@ impl Property { Ok(()) } - /// Ensure all `OutputPropertyValue`'s with unique option set are unique, except of null non required ones - pub fn ensure_unique_option_satisfied( - &self, - new_value_property_id: PropertyId, - new_value: &OutputPropertyValue, - updated_values_for_existing_properties: &OutputValuesForExistingProperties, - ) -> dispatch::Result { - if self.unique && (*new_value != OutputPropertyValue::default() || self.required) { - ensure!( - updated_values_for_existing_properties - .iter() - // Skip current property value - .filter(|(property_id, _)| **property_id != new_value_property_id) - .map(|(_, updated_value_for_existing_property)| { - updated_value_for_existing_property.get_value() - }) - .all(|value| *value != *new_value), - ERROR_PROPERTY_VALUE_SHOULD_BE_UNIQUE - ); - } - Ok(()) - } - /// Validate new `InputPropertyValue` against the type of this `Property` /// and check any additional constraints pub fn ensure_property_value_to_update_is_valid( diff --git a/runtime-modules/content-directory/src/tests/add_schema_support_to_entity.rs b/runtime-modules/content-directory/src/tests/add_schema_support_to_entity.rs index 4b5657d78a..5839835cfe 100644 --- a/runtime-modules/content-directory/src/tests/add_schema_support_to_entity.rs +++ b/runtime-modules/content-directory/src/tests/add_schema_support_to_entity.rs @@ -1292,93 +1292,93 @@ fn add_schema_support_vec_property_is_too_long() { }) } -#[test] -fn add_schema_support_property_should_be_unique() { - with_test_externalities(|| { - // Create class with default permissions - assert_ok!(create_simple_class(LEAD_ORIGIN, ClassType::Valid)); - - let actor = Actor::Lead; - - // Create entity - assert_ok!(create_entity(LEAD_ORIGIN, FIRST_CLASS_ID, actor.to_owned())); - - let property_type = PropertyType::::single_text(TextMaxLengthConstraint::get()); - - // Create first text property - - let first_property = Property::::with_name_and_type( - PropertyNameLengthConstraint::get().max() as usize, - property_type.clone(), - true, - true, - ); - - // Create second text property - - let second_property = Property::::with_name_and_type( - PropertyNameLengthConstraint::get().max() as usize - 1, - property_type, - true, - true, - ); - - // Add first Schema to the Class - assert_ok!(add_class_schema( - LEAD_ORIGIN, - FIRST_CLASS_ID, - BTreeSet::new(), - vec![first_property] - )); - - // Add second Schema to the Class - assert_ok!(add_class_schema( - LEAD_ORIGIN, - FIRST_CLASS_ID, - BTreeSet::new(), - vec![second_property] - )); - - let mut first_schema_property_values = BTreeMap::new(); - - let schema_property_value = - InputPropertyValue::::single_text(TextMaxLengthConstraint::get()); - - first_schema_property_values.insert(FIRST_PROPERTY_ID, schema_property_value.clone()); - - // Add Entity Schema support - assert_ok!(add_schema_support_to_entity( - LEAD_ORIGIN, - actor.to_owned(), - FIRST_ENTITY_ID, - FIRST_SCHEMA_ID, - first_schema_property_values, - )); - - // Runtime state before tested call - - // Events number before tested call - let number_of_events_before_call = System::events().len(); - - let mut second_schema_property_values = BTreeMap::new(); - - second_schema_property_values.insert(SECOND_PROPERTY_ID, schema_property_value); - - // Make an attempt to add schema support to the entity, providing property value(s), which have duplicates or identical to thouse, - // are already added to The Entity, though should be unique on Class Property level - let add_schema_support_to_entity_result = add_schema_support_to_entity( - LEAD_ORIGIN, - actor, - FIRST_ENTITY_ID, - SECOND_SCHEMA_ID, - second_schema_property_values, - ); - - // Failure checked - assert_failure( - add_schema_support_to_entity_result, - ERROR_PROPERTY_VALUE_SHOULD_BE_UNIQUE, - number_of_events_before_call, - ); - }) -} +// #[test] +// fn add_schema_support_property_should_be_unique() { +// with_test_externalities(|| { +// // Create class with default permissions +// assert_ok!(create_simple_class(LEAD_ORIGIN, ClassType::Valid)); + +// let actor = Actor::Lead; + +// // Create entity +// assert_ok!(create_entity(LEAD_ORIGIN, FIRST_CLASS_ID, actor.to_owned())); + +// let property_type = PropertyType::::single_text(TextMaxLengthConstraint::get()); + +// // Create first text property + +// let first_property = Property::::with_name_and_type( +// PropertyNameLengthConstraint::get().max() as usize, +// property_type.clone(), +// true, +// true, +// ); + +// // Create second text property + +// let second_property = Property::::with_name_and_type( +// PropertyNameLengthConstraint::get().max() as usize - 1, +// property_type, +// true, +// true, +// ); + +// // Add first Schema to the Class +// assert_ok!(add_class_schema( +// LEAD_ORIGIN, +// FIRST_CLASS_ID, +// BTreeSet::new(), +// vec![first_property] +// )); + +// // Add second Schema to the Class +// assert_ok!(add_class_schema( +// LEAD_ORIGIN, +// FIRST_CLASS_ID, +// BTreeSet::new(), +// vec![second_property] +// )); + +// let mut first_schema_property_values = BTreeMap::new(); + +// let schema_property_value = +// InputPropertyValue::::single_text(TextMaxLengthConstraint::get()); + +// first_schema_property_values.insert(FIRST_PROPERTY_ID, schema_property_value.clone()); + +// // Add Entity Schema support +// assert_ok!(add_schema_support_to_entity( +// LEAD_ORIGIN, +// actor.to_owned(), +// FIRST_ENTITY_ID, +// FIRST_SCHEMA_ID, +// first_schema_property_values, +// )); + +// // Runtime state before tested call + +// // Events number before tested call +// let number_of_events_before_call = System::events().len(); + +// let mut second_schema_property_values = BTreeMap::new(); + +// second_schema_property_values.insert(SECOND_PROPERTY_ID, schema_property_value); + +// // Make an attempt to add schema support to the entity, providing property value(s), which have duplicates or identical to thouse, +// // are already added to The Entity, though should be unique on Class Property level +// let add_schema_support_to_entity_result = add_schema_support_to_entity( +// LEAD_ORIGIN, +// actor, +// FIRST_ENTITY_ID, +// SECOND_SCHEMA_ID, +// second_schema_property_values, +// ); + +// // Failure checked +// assert_failure( +// add_schema_support_to_entity_result, +// ERROR_PROPERTY_VALUE_SHOULD_BE_UNIQUE, +// number_of_events_before_call, +// ); +// }) +// } diff --git a/runtime-modules/content-directory/src/tests/insert_at_entity_property_vector.rs b/runtime-modules/content-directory/src/tests/insert_at_entity_property_vector.rs index 17d314d8cf..887fec1aa9 100644 --- a/runtime-modules/content-directory/src/tests/insert_at_entity_property_vector.rs +++ b/runtime-modules/content-directory/src/tests/insert_at_entity_property_vector.rs @@ -884,6 +884,7 @@ fn insert_at_entity_property_vector_text_prop_is_too_long() { }) } +#[test] fn insert_at_entity_property_vector_hashed_text_prop_is_too_long() { with_test_externalities(|| { // Create class with default permissions diff --git a/runtime-modules/content-directory/src/tests/transfer_entity_ownership.rs b/runtime-modules/content-directory/src/tests/transfer_entity_ownership.rs index 16e650b4b2..3e6d360b86 100644 --- a/runtime-modules/content-directory/src/tests/transfer_entity_ownership.rs +++ b/runtime-modules/content-directory/src/tests/transfer_entity_ownership.rs @@ -609,139 +609,139 @@ fn transfer_entity_ownership_required_property_was_not_provided() { }) } -#[test] -fn transfer_entity_ownership_unique_constraint_violation() { - with_test_externalities(|| { - // Create class with default permissions - assert_ok!(create_simple_class(LEAD_ORIGIN, ClassType::Valid)); - - // Create first unique reference property with same_controller flag set - let property_type = PropertyType::::vec_reference( - FIRST_CLASS_ID, - true, - VecMaxLengthConstraint::get(), - ); - - let first_property = Property::::with_name_and_type( - (PropertyNameLengthConstraint::get().max() - 1) as usize, - property_type.clone(), - true, - true, - ); - - // Add first Schema to the Class - assert_ok!(add_class_schema( - LEAD_ORIGIN, - FIRST_CLASS_ID, - BTreeSet::new(), - vec![first_property] - )); - - // Create second reference property with same_controller flag set - let second_property = Property::::with_name_and_type( - PropertyNameLengthConstraint::get().max() as usize, - property_type, - true, - false, - ); - - // Add second Schema to the Class - assert_ok!(add_class_schema( - LEAD_ORIGIN, - FIRST_CLASS_ID, - BTreeSet::new(), - vec![second_property] - )); - - // Update class permissions to force any member be available to create Entities - assert_ok!(update_class_permissions( - LEAD_ORIGIN, - FIRST_CLASS_ID, - Some(true), - None, - None, - None - )); - - let actor = Actor::Lead; - - // Create first entity - assert_ok!(create_entity(LEAD_ORIGIN, FIRST_CLASS_ID, actor.clone())); - - // Create second entity - assert_ok!(create_entity(LEAD_ORIGIN, FIRST_CLASS_ID, actor.clone())); - - let first_schema_property_value = - InputPropertyValue::::vec_reference(vec![SECOND_ENTITY_ID, SECOND_ENTITY_ID]); - - let mut schema_property_values = BTreeMap::new(); - schema_property_values.insert(FIRST_PROPERTY_ID, first_schema_property_value); - - // Add first schema support to the first Entity - assert_ok!(add_schema_support_to_entity( - LEAD_ORIGIN, - actor.to_owned(), - FIRST_ENTITY_ID, - FIRST_SCHEMA_ID, - schema_property_values - )); - - let second_schema_property_value = InputPropertyValue::::vec_reference(vec![ - SECOND_ENTITY_ID, - SECOND_ENTITY_ID, - SECOND_ENTITY_ID, - ]); - - let mut schema_property_values = BTreeMap::new(); - schema_property_values.insert(SECOND_PROPERTY_ID, second_schema_property_value); - - // Add second schema support to the first Entity - assert_ok!(add_schema_support_to_entity( - LEAD_ORIGIN, - actor, - FIRST_ENTITY_ID, - SECOND_SCHEMA_ID, - schema_property_values - )); - - // Create third entity - assert_ok!(create_entity( - FIRST_MEMBER_ORIGIN, - FIRST_CLASS_ID, - Actor::Member(FIRST_MEMBER_ID) - )); - - let new_controller = EntityController::Member(FIRST_MEMBER_ID); - - let schema_property_value = InputPropertyValue::::vec_reference(vec![ - THIRD_ENTITY_ID, - THIRD_ENTITY_ID, - THIRD_ENTITY_ID, - ]); - - let mut schema_property_values = BTreeMap::new(); - schema_property_values.insert(FIRST_PROPERTY_ID, schema_property_value.clone()); - schema_property_values.insert(SECOND_PROPERTY_ID, schema_property_value); - - // Runtime state before tested call - - // Events number before tested call - let number_of_events_before_call = System::events().len(); - - // Make an attempt to transfer ownership of Entity, providing new property value reference(s) with same owner flag set, - // which have duplicates or identical to thouse, are already added to The Entity, though should be unique on Class Property level - let transfer_entity_ownership_result = transfer_entity_ownership( - LEAD_ORIGIN, - FIRST_ENTITY_ID, - new_controller, - schema_property_values, - ); - - // Failure checked - assert_failure( - transfer_entity_ownership_result, - ERROR_PROPERTY_VALUE_SHOULD_BE_UNIQUE, - number_of_events_before_call, - ); - }) -} +// #[test] +// fn transfer_entity_ownership_unique_constraint_violation() { +// with_test_externalities(|| { +// // Create class with default permissions +// assert_ok!(create_simple_class(LEAD_ORIGIN, ClassType::Valid)); + +// // Create first unique reference property with same_controller flag set +// let property_type = PropertyType::::vec_reference( +// FIRST_CLASS_ID, +// true, +// VecMaxLengthConstraint::get(), +// ); + +// let first_property = Property::::with_name_and_type( +// (PropertyNameLengthConstraint::get().max() - 1) as usize, +// property_type.clone(), +// true, +// true, +// ); + +// // Add first Schema to the Class +// assert_ok!(add_class_schema( +// LEAD_ORIGIN, +// FIRST_CLASS_ID, +// BTreeSet::new(), +// vec![first_property] +// )); + +// // Create second reference property with same_controller flag set +// let second_property = Property::::with_name_and_type( +// PropertyNameLengthConstraint::get().max() as usize, +// property_type, +// true, +// false, +// ); + +// // Add second Schema to the Class +// assert_ok!(add_class_schema( +// LEAD_ORIGIN, +// FIRST_CLASS_ID, +// BTreeSet::new(), +// vec![second_property] +// )); + +// // Update class permissions to force any member be available to create Entities +// assert_ok!(update_class_permissions( +// LEAD_ORIGIN, +// FIRST_CLASS_ID, +// Some(true), +// None, +// None, +// None +// )); + +// let actor = Actor::Lead; + +// // Create first entity +// assert_ok!(create_entity(LEAD_ORIGIN, FIRST_CLASS_ID, actor.clone())); + +// // Create second entity +// assert_ok!(create_entity(LEAD_ORIGIN, FIRST_CLASS_ID, actor.clone())); + +// let first_schema_property_value = +// InputPropertyValue::::vec_reference(vec![SECOND_ENTITY_ID, SECOND_ENTITY_ID]); + +// let mut schema_property_values = BTreeMap::new(); +// schema_property_values.insert(FIRST_PROPERTY_ID, first_schema_property_value); + +// // Add first schema support to the first Entity +// assert_ok!(add_schema_support_to_entity( +// LEAD_ORIGIN, +// actor.to_owned(), +// FIRST_ENTITY_ID, +// FIRST_SCHEMA_ID, +// schema_property_values +// )); + +// let second_schema_property_value = InputPropertyValue::::vec_reference(vec![ +// SECOND_ENTITY_ID, +// SECOND_ENTITY_ID, +// SECOND_ENTITY_ID, +// ]); + +// let mut schema_property_values = BTreeMap::new(); +// schema_property_values.insert(SECOND_PROPERTY_ID, second_schema_property_value); + +// // Add second schema support to the first Entity +// assert_ok!(add_schema_support_to_entity( +// LEAD_ORIGIN, +// actor, +// FIRST_ENTITY_ID, +// SECOND_SCHEMA_ID, +// schema_property_values +// )); + +// // Create third entity +// assert_ok!(create_entity( +// FIRST_MEMBER_ORIGIN, +// FIRST_CLASS_ID, +// Actor::Member(FIRST_MEMBER_ID) +// )); + +// let new_controller = EntityController::Member(FIRST_MEMBER_ID); + +// let schema_property_value = InputPropertyValue::::vec_reference(vec![ +// THIRD_ENTITY_ID, +// THIRD_ENTITY_ID, +// THIRD_ENTITY_ID, +// ]); + +// let mut schema_property_values = BTreeMap::new(); +// schema_property_values.insert(FIRST_PROPERTY_ID, schema_property_value.clone()); +// schema_property_values.insert(SECOND_PROPERTY_ID, schema_property_value); + +// // Runtime state before tested call + +// // Events number before tested call +// let number_of_events_before_call = System::events().len(); + +// // Make an attempt to transfer ownership of Entity, providing new property value reference(s) with same owner flag set, +// // which have duplicates or identical to thouse, are already added to The Entity, though should be unique on Class Property level +// let transfer_entity_ownership_result = transfer_entity_ownership( +// LEAD_ORIGIN, +// FIRST_ENTITY_ID, +// new_controller, +// schema_property_values, +// ); + +// // Failure checked +// assert_failure( +// transfer_entity_ownership_result, +// ERROR_PROPERTY_VALUE_SHOULD_BE_UNIQUE, +// number_of_events_before_call, +// ); +// }) +// } diff --git a/runtime-modules/content-directory/src/tests/update_entity_property_values.rs b/runtime-modules/content-directory/src/tests/update_entity_property_values.rs index bd33c76add..065aee3961 100644 --- a/runtime-modules/content-directory/src/tests/update_entity_property_values.rs +++ b/runtime-modules/content-directory/src/tests/update_entity_property_values.rs @@ -960,85 +960,85 @@ fn update_entity_property_values_same_controller_constraint_violation() { }) } -#[test] -fn update_entity_property_values_property_should_be_unique() { - with_test_externalities(|| { - // Create class with default permissions - assert_ok!(create_simple_class(LEAD_ORIGIN, ClassType::Valid)); - - let actor = Actor::Lead; - - // Create first Entity - assert_ok!(create_entity(LEAD_ORIGIN, FIRST_CLASS_ID, actor.clone())); - - // Create class reference schema and add corresponding schema support to the Entity - add_class_reference_schema_and_entity_schema_support(&actor, LEAD_ORIGIN); - - // Create second property with unique constraint - let property_type = PropertyType::::vec_reference( - FIRST_CLASS_ID, - true, - VecMaxLengthConstraint::get(), - ); - - let property = Property::::with_name_and_type( - PropertyNameLengthConstraint::get().max() as usize, - property_type, - true, - true, - ); - - // Add second Schema to the Class - assert_ok!(add_class_schema( - LEAD_ORIGIN, - FIRST_CLASS_ID, - BTreeSet::new(), - vec![property] - )); - - let schema_property_value = InputPropertyValue::::vec_reference(vec![ - FIRST_ENTITY_ID, - FIRST_ENTITY_ID, - FIRST_ENTITY_ID, - ]); - - let mut schema_property_values = BTreeMap::new(); - schema_property_values.insert(SECOND_PROPERTY_ID, schema_property_value); - - // Add schema support to the entity - assert_ok!(add_schema_support_to_entity( - LEAD_ORIGIN, - actor.to_owned(), - FIRST_ENTITY_ID, - SECOND_SCHEMA_ID, - schema_property_values - )); - - // Runtime state before tested call - - // Events number before tested call - let number_of_events_before_call = System::events().len(); - - let mut schema_new_property_values = BTreeMap::new(); - let schema_new_property_value = - InputPropertyValue::::vec_reference(vec![FIRST_ENTITY_ID, FIRST_ENTITY_ID]); - - schema_new_property_values.insert(SECOND_PROPERTY_ID, schema_new_property_value); - - // Make an attempt to update entity property values, providing property value(s), which are identical to thouse, - // are already added to The Entity, though should be unique on Class Property level - let update_entity_property_values_result = update_entity_property_values( - LEAD_ORIGIN, - actor, - FIRST_ENTITY_ID, - schema_new_property_values, - ); - - // Failure checked - assert_failure( - update_entity_property_values_result, - ERROR_PROPERTY_VALUE_SHOULD_BE_UNIQUE, - number_of_events_before_call, - ); - }) -} +// #[test] +// fn update_entity_property_values_property_should_be_unique() { +// with_test_externalities(|| { +// // Create class with default permissions +// assert_ok!(create_simple_class(LEAD_ORIGIN, ClassType::Valid)); + +// let actor = Actor::Lead; + +// // Create first Entity +// assert_ok!(create_entity(LEAD_ORIGIN, FIRST_CLASS_ID, actor.clone())); + +// // Create class reference schema and add corresponding schema support to the Entity +// add_class_reference_schema_and_entity_schema_support(&actor, LEAD_ORIGIN); + +// // Create second property with unique constraint +// let property_type = PropertyType::::vec_reference( +// FIRST_CLASS_ID, +// true, +// VecMaxLengthConstraint::get(), +// ); + +// let property = Property::::with_name_and_type( +// PropertyNameLengthConstraint::get().max() as usize, +// property_type, +// true, +// true, +// ); + +// // Add second Schema to the Class +// assert_ok!(add_class_schema( +// LEAD_ORIGIN, +// FIRST_CLASS_ID, +// BTreeSet::new(), +// vec![property] +// )); + +// let schema_property_value = InputPropertyValue::::vec_reference(vec![ +// FIRST_ENTITY_ID, +// FIRST_ENTITY_ID, +// FIRST_ENTITY_ID, +// ]); + +// let mut schema_property_values = BTreeMap::new(); +// schema_property_values.insert(SECOND_PROPERTY_ID, schema_property_value); + +// // Add schema support to the entity +// assert_ok!(add_schema_support_to_entity( +// LEAD_ORIGIN, +// actor.to_owned(), +// FIRST_ENTITY_ID, +// SECOND_SCHEMA_ID, +// schema_property_values +// )); + +// // Runtime state before tested call + +// // Events number before tested call +// let number_of_events_before_call = System::events().len(); + +// let mut schema_new_property_values = BTreeMap::new(); +// let schema_new_property_value = +// InputPropertyValue::::vec_reference(vec![FIRST_ENTITY_ID, FIRST_ENTITY_ID]); + +// schema_new_property_values.insert(SECOND_PROPERTY_ID, schema_new_property_value); + +// // Make an attempt to update entity property values, providing property value(s), which are identical to thouse, +// // are already added to The Entity, though should be unique on Class Property level +// let update_entity_property_values_result = update_entity_property_values( +// LEAD_ORIGIN, +// actor, +// FIRST_ENTITY_ID, +// schema_new_property_values, +// ); + +// // Failure checked +// assert_failure( +// update_entity_property_values_result, +// ERROR_PROPERTY_VALUE_SHOULD_BE_UNIQUE, +// number_of_events_before_call, +// ); +// }) +// }