-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add StardustDocumentMetadata
, implement StardustDocument
methods
#951
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.
/// Additional attributes related to a [`StardustDocument`][crate::StardustDocument]. | ||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] | ||
pub struct StardustDocumentMetadata { | ||
// TODO: store created in the immutable metadata, if possible? |
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.
Good idea, I'll see about that in the client impl.
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.
It would be nice but I don't know what format the immutable metadata is meant to take for other purposes: they don't have a dedicated created
timestamp as far as I know. It might be fine for Alias Outputs used only as DID Documents though.
@@ -86,7 +86,7 @@ async function revokeVC(storage?: Storage) { | |||
|
|||
// Update the RevocationBitmap service in the issuer's DID Document. | |||
// This revokes the credential's unique index. | |||
await issuer.revokeCredentials("my-revocation-service", 5); | |||
await issuer.revokeIndices("my-revocation-service", 5); |
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.
Not sure about the rename. I feel like "revoke indices" is not very clear in what it does. I think I still prefer revokeCredentials
or perhaps revokeCredentialIndices
?
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.
It's to better match the function parameters and reserve the revoke_credentials
name for a convenience function that actually takes in a &Credential
to extract the status
and revocationBitmapIndex
automatically (perhaps on the Account
). Right now it's assumed that the index and service are known to the revoker, so we don't show how tedious those steps actually are.
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.
I understand the argument against revokeCredentials
. I think revokeCredentialIndices
wouldn't be too bad and would be more specific than revokeIndices
. Just an opinion, entirely optional.
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.
What about revokeBitmapIndices
?
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.
Slightly better, just not entirely clear that it refers to indices that correspond to credentials, in my opinion.
I'm mainly concerned about readability. So when you read through an example and you see account.revokeBitmapIndices("#my-revocation-service", 5);
, it doesn't say credential anywhere even though that's what it's ultimately about. But it's probably usually clear from context, so might be fine.
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.
just not entirely clear that it refers to indices that correspond to credentials
But they might not.
Edit: an index could relate to a group of credentials or something else entirely.
But it's probably usually clear from context, so might be fine.
It's commented in the example code and one would have to extract the index from the credential (or store it) under normal circumstances.
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.
Reverted to revoke_credentials
for now until consensus can be reached. Should have been done in a different PR regardless.
Description of change
Fleshes out the
StardustDocument
with getters, setters, and aDocument
implementation for parity withIotaDocument
. Also addsStardustDocumentMetadata
for thecreated
,updated
timestamps.Update the Stardust
create_did
example to demonstrate how to increase the deposit amount automatically and destroy the Alias Output.Added
StardustDocumentMetadata
.StardustDocument
methods.Changed
StardustDocument
to includeStardustDocumentMetadata
.iota-client
pin to latest commit.iota-crypto
to fix compilation.StardustDocument::deserialize_inner
tounpack
.Removed
StardustDocument::deserialize_from_block
.StardustDocument::tmp_*
temporary methods.Links to any relevant issues
Task of #908.
Type of change
How the change has been tested
Added unit tests, updated example works.
Change checklist