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

Refactor/dataverse vc #433

Merged
merged 2 commits into from
Nov 30, 2023
Merged

Refactor/dataverse vc #433

merged 2 commits into from
Nov 30, 2023

Conversation

ccamel
Copy link
Member

@ccamel ccamel commented Nov 28, 2023

Context

The process of redesigning the OKP4 ontology (cf. axone-protocol/ontology#205 and axone-protocol/ontology#212) necessitates the restructuring of the Execution Messages provided by the Dataverse Smart Contract. This restructuring involves removing many messages that are no longer relevant, as all information contributed to the dataverse is now conveyed through Verifiable Credentials.

PR purpose

This PR redefines the scope of the smart contract's execution messages, providing only the minimal functional surface required for managing the resources of the Dataverse.

Summary by CodeRabbit

  • New Features

    • Introduced SubmitClaims to allow entities to submit new claims about resources.
    • Added RevokeClaims for revoking previously submitted claims.
  • Documentation

    • Updated documentation to reflect new SubmitClaims and RevokeClaims functionality.
    • Clarified the use of Verifiable Presentations in claim submission.
  • Refactor

    • Removed RegisterService and RegisterDigitalResource variants.
    • Removed Did type and refined Uri type usage.
  • Bug Fixes

    • Enhanced descriptions and preconditions for claim submission and revocation to ensure integrity.

@ccamel ccamel self-assigned this Nov 28, 2023
Copy link

coderabbitai bot commented Nov 28, 2023

Walkthrough

The OKP4 Dataverse has undergone a transformation, shifting from service and resource registration to a claims-based model. Entities can now submit and revoke claims about resources, with a focus on Verifiable Presentations and maintaining the dataverse's integrity. The changes streamline the process, enhancing the system's flexibility and expressiveness in handling data assertions.

Changes

File Path Change Summary
contracts/.../src/msg.rs Replaced RegisterService with SubmitClaims, removed RegisterDigitalResource and FoundZone, added details for claim submission and revocation, removed Did type, and modified Uri type.
docs/okp4-dataverse.md Updated documentation to reflect changes in message structures and functionalities, emphasizing the new claims-based approach.

🐇✨
In the dataverse so wide and vast,
Claims now anchor the present and past.
With Verifiable Presentations, we trust,
Integrity blooms from digital dust.
🌟📜


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link

codecov bot commented Nov 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2ebb6cd) 96.84% compared to head (ccaf887) 96.84%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #433   +/-   ##
=======================================
  Coverage   96.84%   96.84%           
=======================================
  Files          49       49           
  Lines       10003    10003           
=======================================
  Hits         9687     9687           
  Misses        316      316           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bot-anik
Copy link
Member

bot-anik commented Nov 28, 2023

size-limit report 📦

Path Size
target/wasm32-unknown-unknown/release/okp4_objectarium.wasm 431.32 KB (0%)
target/wasm32-unknown-unknown/release/okp4_law_stone.wasm 641.22 KB (0%)
target/wasm32-unknown-unknown/release/okp4_cognitarium.wasm 825.08 KB (0%)
target/wasm32-unknown-unknown/release/okp4_dataverse.wasm 218.09 KB (-5.21% 🔽)

@ccamel ccamel marked this pull request as ready for review November 28, 2023 08:27
@ccamel ccamel requested a review from amimart November 28, 2023 08:28
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 2ebb6cd and b9c6f55.
Files selected for processing (2)
  • contracts/okp4-dataverse/src/msg.rs (3 hunks)
  • docs/okp4-dataverse.md (3 hunks)
Additional comments: 6
contracts/okp4-dataverse/src/msg.rs (3)
  • 16-53: The changes to the ExecuteMsg enum and the detailed comments provide clear instructions on how to use the new SubmitClaims variant. The preconditions and format requirements are well-documented, ensuring that users understand how to properly submit claims.

  • 60-68: The addition of the RevokeClaims variant with its precondition is a good practice to ensure that claims can be managed effectively within the dataverse. It's important to ensure that the implementation of this variant checks for the existence of the identifier before attempting to revoke a claim.

  • 188-189: The Uri type alias is correctly defined and follows the standard practice of using a String to represent a URI. This should ensure compatibility with other parts of the system that use URIs.

docs/okp4-dataverse.md (3)
  • 63-89: The documentation for ExecuteMsg::SubmitClaims is comprehensive and clearly explains the format, preconditions, and the use of Verifiable Presentations for submitting claims. This aligns well with the changes made to the smart contract's execution messages.

  • 99-105: The documentation for ExecuteMsg::RevokeClaims is concise and outlines the precondition for revoking claims. It is important to ensure that the implementation of this message in the smart contract adheres to the precondition mentioned.

  • 251-251: The documentation footer indicates the rendering tool and version used. This is helpful for maintaining the documentation and ensuring consistency when future updates are made.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 2ebb6cd and ccaf887.
Files selected for processing (2)
  • contracts/okp4-dataverse/src/msg.rs (3 hunks)
  • docs/okp4-dataverse.md (3 hunks)
Additional comments: 6
contracts/okp4-dataverse/src/msg.rs (3)
  • 16-51: The documentation for SubmitClaims is comprehensive and provides clear guidelines on the format and preconditions for submitting claims. This should help ensure that users of the smart contract understand how to properly submit claims.

  • 58-66: The RevokeClaims variant has been updated with preconditions for revoking claims, which is consistent with the summary. This addition should help ensure that claims are revoked in a controlled manner, maintaining the integrity of the dataverse.

  • 186-187: The Uri type has been updated to represent a Uniform Resource Identifier (URI), which is consistent with the summary. This change is important for the identification of resources within the dataverse.

docs/okp4-dataverse.md (3)
  • 63-87: The updated description and functionality for ExecuteMsg::SubmitClaims align with the changes mentioned in the summary. The detailed explanation of the format, preconditions, and the role of Verifiable Presentations (VPs) in the submission process is clear and informative.

  • 97-103: The updated description and functionality for ExecuteMsg::RevokeClaims align with the changes mentioned in the summary. The preconditions for revoking claims are clearly stated, ensuring that the process is well-defined.

  • 249-249: The rendered information by Fadroma has been updated, as indicated in the summary. This ensures that the documentation reflects the latest changes to the okp4-dataverse.json schema.

@ccamel ccamel merged commit 8cab0ad into main Nov 30, 2023
18 checks passed
@ccamel ccamel deleted the refactor/dataverse-vc branch November 30, 2023 13:04
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.

3 participants