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

Simplify usage of credentials().issue() and ipex().grant() #150

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

lenkan
Copy link
Collaborator

@lenkan lenkan commented Nov 29, 2023

I am working on multisig issuance using signify and found it very hard to follow the flow for multisig issuance => grant. To get a grasp of it I cleaned up the code for issue + grant and I think I found some complicated and repeated code.

In short:

  • Adding IpexGrantArgs and IssueCredentialArgs/IssueCredentialResult interfaces.
  • Simplifying the flow in credentials().issue() function to avoid unnecessary re-assigning of variables and merging of objects.
  • Moving the attachment creation of the embeds into ipex().grant() function to make it easier to use from a caller. This was repeated in all scripts.
  • Enabling the integration tests for multisig.test.ts and credential.test.ts
  • Added the "Operation" type.

I think it should be all correct since it works. I also took inspiration from the commit here pfeairheller@dc98330 to remove the redundant Saider arguments when creating the attachments.

If you do not like it, just let me know and I will close this. I don't necessarily need to get this merged. I just implemented it so that I could figure out how to do multisig credential issuance on my end and thought it was an improvement.

Copy link

codecov bot commented Nov 29, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (4afcb12) 81.01% compared to head (12acc53) 81.21%.

Files Patch % Lines
src/keri/app/credentialing.ts 94.11% 2 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development     #150      +/-   ##
===============================================
+ Coverage        81.01%   81.21%   +0.20%     
===============================================
  Files               46       46              
  Lines             4187     4136      -51     
  Branches          1028     1023       -5     
===============================================
- Hits              3392     3359      -33     
+ Misses             763      745      -18     
  Partials            32       32              

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

@lenkan lenkan force-pushed the credentialing-cleanup branch from 74ed4fa to d04aaac Compare November 29, 2023 16:25
@rodolfomiranda
Copy link
Collaborator

This is a great improvement!. You help me cross out some tasks on my todo list. The change in the ipex().grant() simplify the life of implementors.

@kentbull
Copy link
Contributor

Yes, that's really good to know that you can recreate the Saider instances from the .ked attribute of an ACDC or an Anchor (anc).

- Adding args and result interfaces for issue and grant methods
- Trying to clarify the flow of data
@lenkan lenkan force-pushed the credentialing-cleanup branch from d04aaac to 12acc53 Compare November 30, 2023 16:16
@lenkan lenkan changed the title credentials and multisig integration test scripts Simplify usage of credentials().issue() and ipex().grant() Nov 30, 2023
@lenkan
Copy link
Collaborator Author

lenkan commented Nov 30, 2023

@rodolfomiranda @pfeairheller I have rebased this now on top of development. I rephrased the PR title to reflect the changes now that the integration test was already merged. But the PR description is still valid. Please have a look.

@pfeairheller pfeairheller merged commit 97a1825 into WebOfTrust:development Dec 1, 2023
5 checks passed
@lenkan lenkan deleted the credentialing-cleanup branch December 4, 2023 09:52
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.

4 participants