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

feat: remove async from fromBip39Entropy #1326

Conversation

jinglescode
Copy link
Contributor

Context

functions like fromBip39Entropy() are essential for them to operate without being async, so upstream functions do not required async.

Proposed Solution

pbkdf2 replace with pbkdf2Sync

Important Changes Introduced

  • functions using fromBip39Entropy() can remove await

Copy link
Member

@mkazlauskas mkazlauskas left a 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:
image

Also it would be great to align the Bip32Ed25519 interface

});
static fromBip39Entropy(entropy: Buffer, password: string): Bip32PrivateKey {
const xprv = pbkdf2Sync(
password,
Copy link
Member

Choose a reason for hiding this comment

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

Lint error here

Copy link
Member

@mkazlauskas mkazlauskas left a 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

https://github.com/input-output-hk/cardano-js-sdk/actions/runs/9448898910/job/26053476806?pr=1326#step:4:178

@jinglescode
Copy link
Contributor Author

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

https://github.com/input-output-hk/cardano-js-sdk/actions/runs/9448898910/job/26053476806?pr=1326#step:4:178

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.

Copy link
Member

@AngelCastilloB AngelCastilloB left a comment

Choose a reason for hiding this comment

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

LGTM!

@mkazlauskas mkazlauskas merged commit da736d3 into input-output-hk:master Jun 19, 2024
8 checks passed
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