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

fix(crypto): Add KeypairOptions for fixing tests #2477

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sugyan
Copy link
Contributor

@sugyan sugyan commented May 11, 2024

I found that only .toBeTruthy is written (no parentheses) and not tested in crypto/tests/did.test.ts: it seems to be the only two places in this repository.
After adding the parentheses and running the test, the test failed. This seems to be because did.parseDidKey calls decompressPubkey and returns 65-byte keyBytes, while getPublicKey in @noble/curves generates 33-byte compressed signatures by default.
https://github.com/paulmillr/noble-curves?tab=readme-ov-file#upgrading

If the intended behavior is for parseDidKey to return a decompressed version, then the publicKey to be compared in the test needs to be generated with isCompressed: false. So, I modified it to add an argument in each plugins.

@sugyan sugyan changed the title fix(crypto): Add KeypairOptions for fix tests fix(crypto): Add KeypairOptions for fixing tests May 11, 2024
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.

1 participant