-
Notifications
You must be signed in to change notification settings - Fork 58
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 fromBip39Entropy #1326
feat: remove async from fromBip39Entropy #1326
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.
Thanks for contribution! ❤️ Please also update the usages to not await:
Also it would be great to align the Bip32Ed25519 interface
}); | ||
static fromBip39Entropy(entropy: Buffer, password: string): Bip32PrivateKey { | ||
const xprv = pbkdf2Sync( | ||
password, |
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.
Lint error here
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.
Changes looks good! Need to resolve CI errors before merging, currently at
crypto/src/strategies/CmlBip32Ed25519.ts(24,10): error TS2416: Property 'fromBip39Entropy' in type 'CmlBip32Ed25519' is not assignable to the same property in base type 'Bip32Ed25519'.
which is probably asking to update async->sync in CmlBip32Ed25519
Yea I saw the build error this morning and wanted to fix this this afternoon. So just pushed, and gonna see if this fixes it. |
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.
LGTM!
Context
functions like
fromBip39Entropy()
are essential for them to operate without being async, so upstream functions do not required async.Proposed Solution
pbkdf2
replace withpbkdf2Sync
Important Changes Introduced
fromBip39Entropy()
can removeawait