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

refactor(crypto): remove circular dependency #1942

Conversation

matthieusieben
Copy link
Contributor

@matthieusieben matthieusieben commented Dec 8, 2023

in crypto, there is a circular dependency between did.ts > plugins.ts > p256/plugin.ts > p256/operations.ts > did.ts. This PR fixes that by extracting common code into a utils.ts file, and uses that module instead of did.ts from plugin operations.

@matthieusieben matthieusieben force-pushed the fix-crypto-circular-dep branch 4 times, most recently from af69451 to 8967b76 Compare December 8, 2023 14:33
@matthieusieben matthieusieben force-pushed the fix-crypto-circular-dep branch from 8967b76 to 64270cf Compare February 13, 2024 11:57
@@ -43,7 +42,7 @@ export class Secp256k1Keypair implements Keypair {
}

publicKeyStr(encoding: SupportedEncodings = 'base64pad'): string {
return uint8arrays.toString(this.publicKey, encoding)
return toString(this.publicKey, encoding)
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a reason to import this as just toString? if so I think it'd be nice to import it as something like ui8ToString or similar. otherwise toString is pretty generic & gotta check imports to see what it's coming from

Copy link
Collaborator

@dholms dholms left a comment

Choose a reason for hiding this comment

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

just the one nit, otherwise this looks good 👍

@matthieusieben
Copy link
Contributor Author

Done. Also imported these changes in #2169.

@matthieusieben
Copy link
Contributor Author

Merged through #2169

@matthieusieben matthieusieben deleted the fix-crypto-circular-dep branch March 20, 2024 09:44
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.

2 participants