-
Notifications
You must be signed in to change notification settings - Fork 87
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
Update resolution example to use the new Resolver #838
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just nits.
Slightly related: We don't really consider the Resolver
"low-level", right? Currently, all examples that don't use an account go into the low-level-api
examples, but I think we should at some point rename examples/account
to examples/high-level-api
or similar, and move this example there, and potentially others that don't qualify as low-level.
Edit: On second thought, I think the original plan was to just have a single examples
folder anyway, in which case this inconsistency would also go away.
@PhilippGackstatter This is being done here, so we're gonna have @olivereanderson This is targeting the support branch, shouldn't it also be part of dev? |
This is a good question. Right now I need it on the support branch, but it should be on dev as well. I am very much under the impression that we will merge the support branch into dev at some point? Hence if that is the case I am not sure whether it is fine to wait for that, or if I should submit an extra PR afterwards that targetting dev. @abdulmth @PhilippGackstatter Do you have any preferences here? |
@eike-hass merged my storage wiki article #818 back into dev from the support branch in #832, he can probably help you with that as well for this PR. So if you need it on the support branch, then the current target if the way to go, imo. |
#[tokio::main] | ||
async fn main() -> Result<()> { | ||
// Create a signed DID Document and KeyPair (see create_did.rs). | ||
let (document, _, _): (IotaDocument, KeyPair, Receipt) = create_did::run().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let (document, _, _): (IotaDocument, KeyPair, Receipt) = create_did::run().await?; | |
let account: Account = Account::builder() | |
.create_identity(IdentitySetup::default()) | |
.await? |
In the new examples, we try to make them not depend on each others, and using the account makes it easy to do that, but maybe this requires moving the example to the account folder. So maybe this suggestion is optional for this PR but needed for the new example structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @abdulmth for this insight. It makes a lot of sense to use the Account where possible, but I would indeed like to wait with making your suggested change until we have the new example structure in place. Will definitely make sure to remember this for later though 👍
async function resolveDID(clientConfig) { | ||
|
||
// Creates a new identity (see "create_did" example) | ||
const {key, doc, receipt} = await createIdentity(clientConfig); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same this here as in the rust example.
Co-authored-by: Abdulrahim Al Methiab <31316147+abdulmth@users.noreply.github.com>
Updates the resolution example to use the new Resolver.
…-example Update resolution example to use the new Resolver (#838)
Description of change
Closes #835
Links to any relevant issues
Unblocks #823
Type of change
Add an
x
to the boxes that are relevant to your changes.How the change has been tested
Describe the tests that you ran to verify your changes.
Make sure to provide instructions for the maintainer as well as any relevant configurations.
Change checklist
Add an
x
to the boxes that are relevant to your changes.