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

draft: refactored primitives interfaces #1042

Closed
wants to merge 13 commits into from
Closed

Conversation

bobozaur
Copy link
Contributor

@bobozaur bobozaur commented Oct 31, 2023

PoC redesign of Wallet, Ledger and Vc(Anoncreds) traits.

The Wallet and Ledger traits were split an designed to work with the WalletRecord and LedgerRequest traits.

The WalletRecord and LedgerRequest traits are meant to be implemented on data types that would convert to/from an associated type for the Wallet or Ledger respectively, enabling the interfaces to work with multiple sets of VC data structures, for instance.

The Anoncreds trait is split on roles into VcIssuer, VcVerifier and VcProver. Strong typing and associate types have been added for them.

The Vc traits are meant to work with the Wallet and WalletRecord and have some intense trait bounds that essentially allow a couple of things:

  • the ability to store a record in the wallet.
  • the ability to retrieve a record from the wallet using the designated ID.
  • conversion/linkage between ID data types for the Wallet and WalletRecord that enables the things above.

There are some compile time tests for the VcIssuer implementation for indy to ensure that the traits and their extreme trait bounds are actually usable from consumer code. (VcVerifier is very simple).

NOTE: The trait bounds were a lot of work and involved a lot of trial and error. It's possible some could be removed without affecting the code functionality. Feel free to experiment, as the compiler will surely yell at you if something needed is removed 😅 .

IMPORTANT: While this is sort of replicating the credx implementation for verifiable credentials, it must be reviewed and refactored to use more static typing here and there, as well as ensuring it does the proper thing as some stuff was removed as part of adding strong types for arguments.

@Patrik-Stas
Copy link
Contributor

Given this work being in progress, shall we close #829 ?

@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2023

Codecov Report

Merging #1042 (4809a80) into main (fee4076) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@           Coverage Diff            @@
##            main   #1042      +/-   ##
========================================
- Coverage   0.05%   0.05%   -0.01%     
========================================
  Files        384     387       +3     
  Lines      21249   21379     +130     
  Branches    3835    3847      +12     
========================================
  Hits          12      12              
- Misses     21236   21366     +130     
  Partials       1       1              
Flag Coverage Δ
unittests-aries-vcx 0.05% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
agency_client/src/internal/messaging.rs 0.00% <ø> (ø)
...ocols/mediated_connection/invitee/state_machine.rs 0.00% <ø> (ø)
...ocols/mediated_connection/inviter/state_machine.rs 0.00% <ø> (ø)
aries_vcx/src/utils/encryption_envelope.rs 0.00% <ø> (ø)
aries_vcx_core/src/anoncreds/credx_anoncreds.rs 0.00% <ø> (ø)
...ries_vcx_core/src/errors/mapping_indy_api_types.rs 0.00% <ø> (ø)
aries_vcx/src/common/credentials/encoding.rs 0.00% <0.00%> (ø)
aries_vcx/src/handlers/out_of_band/receiver.rs 0.00% <0.00%> (ø)
...cx_core/src/ledger/request_submitter/vdr_ledger.rs 0.00% <0.00%> (ø)
diddoc_legacy/src/aries/diddoc.rs 0.00% <0.00%> (ø)
... and 3 more

@bobozaur bobozaur marked this pull request as ready for review November 3, 2023 12:17
Copy link
Contributor

@Patrik-Stas Patrik-Stas left a comment

Choose a reason for hiding this comment

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

approval to test some github settings

Copy link
Contributor

@Patrik-Stas Patrik-Stas left a comment

Choose a reason for hiding this comment

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

reverting the testing approval

@Patrik-Stas Patrik-Stas changed the title Raw draft of refactored primitives interfaces Draft: refactored primitives interfaces Nov 26, 2023
@Patrik-Stas Patrik-Stas marked this pull request as draft November 26, 2023 12:08
@Patrik-Stas Patrik-Stas changed the title Draft: refactored primitives interfaces draft: refactored primitives interfaces Nov 26, 2023
@Patrik-Stas
Copy link
Contributor

Closing, for the record, related work is happening in
#1110
#1116
#1118
#1124
#1093
#1084

@Patrik-Stas Patrik-Stas closed this Feb 9, 2024
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