Closed insipx closed 9 months ago
This looks like a pretty good start! I hit a few snags because the tests dont appear to build and there are a few warnings outstanding.
This project may be helpful: https://github.com/OwnYourData/didlint
It appears there is a network api as well.
thanks! Definitely cleanup to do and still working on generating the actual did document from the did history. There is a network endpoint, did_resolveDid
that can be called:
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "did_resolveDid", "params": ["0x6CEb0bF1f28ca4165d5C0A04f61DC733987eD6ad"]}' http://localhost:9944/ | jq .result
After starting with cargo run --release -- p "wss://ethereum-spolia.publicnode.com"
(need to change to env variables)
but currently only returns a stub did document until wrap_did_document
is finished, although it does log the event history if you run the server with RUST_LOG=didethresolver=debug
.
The tests don't build because i haven't updated the with_client harness yet. It requires starting a eth server now which can be done in-code with Foundry, but maybe should be moved to integration tests. While I get the first iteration of wrap_did_document finished i'm just testing against the already-deployed sepolia contract and server
I'll also make sure to test everything with did-lint. In the future, it would be nice to have did-lint run automatically on CI push against Sepolia to verify our documents
This could use some more tests, but overall I feel like it's in a pretty good place. I'll create a ticket for the cases I'd like to create tests for
Attention: 97 lines
in your changes are missing coverage. Please review.
Comparison is base (
ed3cedb
) 91.37% compared to head (19d0af0
) 91.62%.
Files | Patch % | Lines |
---|---|---|
src/types/ethr.rs | 95.00% | 25 Missing :warning: |
src/lib.rs | 0.00% | 15 Missing :warning: |
src/types.rs | 87.50% | 15 Missing :warning: |
src/types/did_url.rs | 91.30% | 12 Missing :warning: |
src/rpc/methods.rs | 54.54% | 10 Missing :warning: |
src/util.rs | 40.00% | 6 Missing :warning: |
src/types/did_parser.rs | 98.10% | 5 Missing :warning: |
src/resolver/did_registry.rs | 80.00% | 4 Missing :warning: |
src/main.rs | 0.00% | 3 Missing :warning: |
src/resolver.rs | 97.50% | 2 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
closes #4
Not implementing for this PR
related to roadmap#23
Example
Run against Sepolia with
RUST_LOG=didethresolver=debug ./target/release/didethresolver -p "wss://ethereum-sepolia.publicnode.com"
example query: ❯
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "did_resolveDid", "params": ["0x423B6F365C14F4b233928088FF937e01c143A328"]}' http://localhost:9944
Pretty print the result: ❯
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "did_resolveDid", "params": ["0x423B6F365C14F4b233928088FF937e01c143A328"]}' http://localhost:9944 | jq .result