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

feat(core): ledger module registerPublicDid implementation #398

Merged

Conversation

genaris
Copy link
Contributor

@genaris genaris commented Jul 20, 2021

Add missing implementation for registerPublicDid in ledger module.

Apart from ledger source files, there were some updates in ledger setup scripts in order to properly run the tests, as it is needed to have some permissions to write public DIDs.

Signed-off-by: Ariel Gentile gentilester@gmail.com

Signed-off-by: Ariel Gentile <gentilester@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Jul 20, 2021

Codecov Report

Merging #398 (46f4dfd) into main (d84acc7) will increase coverage by 0.01%.
The diff coverage is 78.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #398      +/-   ##
==========================================
+ Coverage   86.52%   86.53%   +0.01%     
==========================================
  Files         246      246              
  Lines        5010     5022      +12     
  Branches      788      791       +3     
==========================================
+ Hits         4335     4346      +11     
- Misses        675      676       +1     
Impacted Files Coverage Δ
.../core/src/modules/ledger/services/LedgerService.ts 81.81% <77.77%> (-0.26%) ⬇️
packages/core/src/modules/ledger/LedgerModule.ts 90.00% <80.00%> (+4.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d84acc7...46f4dfd. Read the comment docs.

Signed-off-by: Ariel Gentile <gentilester@gmail.com>
@genaris genaris marked this pull request as ready for review July 20, 2021 21:44
@genaris genaris requested a review from a team as a code owner July 20, 2021 21:44
Copy link
Contributor

@TimoGlastra TimoGlastra left a comment

Choose a reason for hiding this comment

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

Nice work @genaris! I have one question

packages/core/tests/ledger.test.ts Outdated Show resolved Hide resolved
Signed-off-by: Ariel Gentile <gentilester@gmail.com>
response,
})

return targetDid
Copy link
Contributor

Choose a reason for hiding this comment

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

One final nitpick: Maybe we shouldn't return the targetDid? It's already an input parameter, so it doesn't provide extra context to the method caller to return it. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you are right about that. Actually I left it for consistency with other methods from ledger service such as registerSchema and registerCredentialDefinition. Do you think it'd better to return void?

In that way, in the registerPublicDid test I can do a getPublicDid right after the DID registration (something I don't want to do because that that method is tested in a separate test, but probably should be the unique 'good' way to test it).

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is fine for now. We can tackle this in a separate PR and overhaul all methods

@TimoGlastra TimoGlastra merged commit 5f2d512 into openwallet-foundation:main Jul 27, 2021
@genaris genaris deleted the feature/register-public-did branch March 29, 2022 15:47
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.

None yet

3 participants