Skip to content

Feat/validate with document type - #1323

Merged
QuantumExplorer merged 16 commits into
feat/versioningV4from
feat/validate-with-document-type
Aug 24, 2023
Merged

QuantumExplorer merged 16 commits into
feat/versioningV4from
feat/validate-with-document-type

Conversation

@shumkov

@shumkov shumkov commented Aug 17, 2023

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

What was done?

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

shumkov added 14 commits August 15, 2023 19:53
# Conflicts:
#	packages/rs-dpp/src/data_contract/document_type/v0/mod.rs
#	packages/rs-dpp/src/data_contract/methods/mod.rs
#	packages/rs-dpp/src/validation/json_schema_validator/methods/get_schema_compilation_options/mod.rs
#	packages/rs-dpp/src/validation/json_schema_validator/methods/validate_data_contract_schema/v0/mod.rs
#	packages/rs-dpp/src/validation/mod.rs
While refactoring, removed multiple redundant methods in the JsonSchemaValidatorVersions of the DPPValidationVersions struct in the rs-platform-version package. This was done to improve efficiency of the validation process. Also, removed unused imports from multiple other packages including rs-dpp and rs-drive. Fixed the test cases to adapt to these changes and renamed variables for better clarity.

In the DataContractFramework, the code has been optimized to improve the efficiency and readability. Also added a new DataContractMethodVersions struct in mocks/v3_test.rs for structured handling of data contract methods.
This commit includes several minor modifications across numerous files primarily aimed at code cleanliness and maintainability. Unnecessary dependencies that were not used have been removed. This includes the removal of 'TryFrom', 'ConsensusError', 'DocumentType', 'StatelessJsonSchemaLazyValidator', 'SimpleConsensusValidationResult' and others. These changes streamline the codebase by removing unused dependencies and hence contribute to improved readability and easier maintenance.
The import of validation and conversion related features have been changed to be conditional based on whether the "validation" feature is enabled. Modification is done in several files:
- Three files are updated to include validation feature under conditional import.
- `rs-dpp/Cargo.toml` is updated with 'document-value-conversion' under 'validation' feature.
- Imports in `identity_factory.rs` is updated to include `IdentityPlatformValueConversionMethodsV0` inside a conditional validation check.

These changes bring import calls inside the relevant scopes, reducing memory overhead when validation feature is not
# Conflicts:
#	packages/rs-dpp/src/identity/identity_factory.rs

impl Index {
/// Check to see if two objects are conflicting
pub fn objects_are_conflicting(&self, object1: &ValueMap, object2: &ValueMap) -> bool {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we shouldn't remove this... this could be useful for outside libraries even.

@QuantumExplorer
QuantumExplorer changed the base branch from feat/versioningV3 to v0.25-dev-nightly August 20, 2023 16:20
@QuantumExplorer
QuantumExplorer changed the base branch from v0.25-dev-nightly to feat/versioningV3 August 20, 2023 16:23
@QuantumExplorer
QuantumExplorer changed the base branch from feat/versioningV3 to feat/versioningV4 August 20, 2023 16:25
@QuantumExplorer
QuantumExplorer marked this pull request as ready for review August 24, 2023 07:54
@QuantumExplorer
QuantumExplorer merged commit 3507cc7 into feat/versioningV4 Aug 24, 2023
@QuantumExplorer
QuantumExplorer deleted the feat/validate-with-document-type branch August 24, 2023 07:54
QuantumExplorer added a commit that referenced this pull request Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants