-
Notifications
You must be signed in to change notification settings - Fork 63
feat: remove async from crypto API #1558
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
feat: remove async from crypto API #1558
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! Please update commit message to indicate breaking changes
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.
Fantastic work @AngelCastilloB 🚀
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.
Nice work! 🚀
f122c41
to
dfc1811
Compare
0d664a6
BREAKING CHANGE: The package now exports an async `ready` function that must be called before any of crypto related functions can be called - Bip32PrivateKe async functions are all now sync - Bip32PublicKey class async functions are all now sync - Ed25519PrivateKey class async functions are all now sync - Ed25519PublicKey class async functions are all now sync - Bip32Ed25519 interface async functions are all now sync - SodiumBip32Ed25519 cosntructor is now private - SodiumBip32Ed25519 now has a new async factory method create
1719108
to
91b7fa2
Compare
Bip32Ed25519 was refactored to synchronous methods by hoisting sodium await to top level in #1558, which makes it difficult to use SigningCoordinator without top level await
Bip32Ed25519 was refactored to synchronous methods by hoisting sodium await to top level in #1558, which makes it difficult to use SigningCoordinator without top level await
Context
The crypto interface currently is async because it uses libsodium underneath which requires an async call to sodium.ready. We can remove the async from the interface and hoist it to the strategy constructor or a global method async Crypto.ready, that can be called by the client code at their convenience.
Resolves #1529