Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content dir 2 issue 13 #278

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
35b40f5
avoid potential panic, when completing entity property values update
iorveth Apr 13, 2020
d7f3269
clear, remove_at property value level vector operations initial imple…
iorveth Apr 13, 2020
d4a085d
Property value level insert_at vector operation implemented
iorveth Apr 14, 2020
a778bed
insert_at error improvements
iorveth Apr 15, 2020
eaf1aef
Security: implement mechanism for entity vector level specific operat…
iorveth Apr 15, 2020
6821daa
Entity property vector cleaning basic test coverage
iorveth Apr 15, 2020
10d8be7
Entity property vector remove_at basic test coverage
iorveth Apr 15, 2020
3dbdc40
Tests: refactoring
iorveth Apr 15, 2020
39e0cf2
Entity property vector insert_at basic test coverage
iorveth Apr 15, 2020
639e637
Core logic refactoring, insert_at ReferenceVec, when uknown internal …
iorveth Apr 16, 2020
2eccac7
Fix clippy warnings
iorveth Apr 17, 2020
52bd20f
Introduce new nonce-like mechanism, tests updated
iorveth Apr 17, 2020
85c5354
Improve error handling, when entity vector value index is out of range
iorveth Apr 17, 2020
e0ee630
Tests: add respective failure cases for insert_at, remove_at entity v…
iorveth Apr 17, 2020
3de80c0
Fix nonce mechanism design issue
iorveth Apr 21, 2020
766c8ce
Raw index u16 types, except of schema id type, replaced with respecti…
iorveth Apr 21, 2020
279e5da
SchemaId type alias introduced
iorveth Apr 22, 2020
a161533
Bunch of refactoring & optimizations
iorveth Apr 22, 2020
1d53021
Fix mut in required() method
iorveth Apr 22, 2020
d533491
Entity removal implementation, part 1
iorveth Apr 22, 2020
3a4df8c
Add additional equality check to forbid updating equal prop values
iorveth Apr 23, 2020
21a344e
Entity removal implementation, part 2
iorveth Apr 23, 2020
1f8eec3
Fix add schema support not updating entity counter in case of reference
iorveth Apr 23, 2020
2067612
Fix batch transaction test
iorveth Apr 24, 2020
629ba85
Bunch of matching trees refactoring
iorveth Apr 24, 2020
9725e55
Entities removal test coverage added
iorveth Apr 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add additional equality check to forbid updating equal prop values
  • Loading branch information
iorveth committed Apr 23, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 3a4df8c45ce15d47d2ecaf9a3581bf213bd392af
18 changes: 10 additions & 8 deletions runtime-modules/content-directory/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1202,14 +1202,16 @@ impl<T: Trait> Module<T> {
if let Some(current_prop_value) = updated_values.get_mut(&id) {
// Get class-level information about this property
if let Some(class_prop) = class.properties.get(id as usize) {
// Validate a new property value against the type of this property
// and check any additional constraints like the length of a vector
// if it's a vector property or the length of a text if it's a text property.
Self::ensure_property_value_to_update_is_valid(&new_value, class_prop)?;

// Update a current prop value in a mutable vector, if a new value is valid.
current_prop_value.update(new_value);
updated = true;
if new_value != *current_prop_value {
// Validate a new property value against the type of this property
// and check any additional constraints like the length of a vector
// if it's a vector property or the length of a text if it's a text property.
Self::ensure_property_value_to_update_is_valid(&new_value, class_prop)?;

// Update a current prop value in a mutable vector, if a new value is valid.
current_prop_value.update(new_value);
updated = true;
}
}
} else {
// Throw an error if a property was not found on entity