Skip to content

chore: update bundle test #892

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

Merged
merged 6 commits into from
Jul 31, 2024
Merged

chore: update bundle test #892

merged 6 commits into from
Jul 31, 2024

Conversation

abdulmth
Copy link
Contributor

@rflechtner we still need to add testing for credentials.

@rflechtner rflechtner requested a review from ntn-x2 July 30, 2024 13:13
Copy link
Contributor

@rflechtner rflechtner left a comment

Choose a reason for hiding this comment

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

I added credential tests in 5423484, for which I switched the VM we add to be a assertionMethod. I also added some logging and assertions (ccf2660, 3c65a65)

Copy link
Member

@ntn-x2 ntn-x2 left a comment

Choose a reason for hiding this comment

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

Very nice!

const vmTransactionResult = await Kilt.DidHelpers.setVerificationMethod({
api,
didDocument,
signers: [...signers, assertionKeyPair],
Copy link
Member

Choose a reason for hiding this comment

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

I mean, technically you don't need to extend the signers, since the authentication key is the only one required for this operation, right?

Copy link
Member

Choose a reason for hiding this comment

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

Also it would help to have cases where the same key is not added to both the signers and in the publicKey argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah but the signers variable for the next operations will lack the needed keys, I would say we keep it as is.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah but the signers variable is anyway re-initialized below with vmTransactionResult.asConfirmed, so this is not needed. But this was my suggestion. Feel free to disregard it and resolve the conversation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah the rationale was that adding the key here would transform it to a signer and adds it to the signers array. This way you avoid having a mixed type. Providing DID signers for your DID is one of the two things the asConfirmed getter does for you (the other is returning the didDocument)

}

// TODO: Should we at least be able to load an existing CType from the chain?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rflechtner why is this not possible?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can do so via importing the CTypeLoader from @kiltprotocol/credentials. But the bundle only has sdk-js functions available.

@rflechtner rflechtner merged commit 3c299bd into develop Jul 31, 2024
14 checks passed
@rflechtner rflechtner deleted the abd-update-bundle-tests branch July 31, 2024 15:36
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.

3 participants