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: Use fromMnemonic instead of non-existent fromPhrase #334

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

Conversation

mdqst
Copy link

@mdqst mdqst commented Jan 25, 2025

Description

I noticed that the code was using fromPhrase, which doesn't exist in the ethers library.
This has been corrected to use fromMnemonic for creating a wallet from a mnemonic phrase.

The change ensures compatibility with the library and resolves the issue.

Copy link
Contributor

@daveroga daveroga left a comment

Choose a reason for hiding this comment

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

fromMnemonic function is not working in the current ethers version that we have in the project.
If we change fromPhrase to fromMnemonic we have an error:

const mnemonicWallet = ethers.Wallet.fromMnemonic(DEFAULT_MNEMONIC);
                                     ^
TypeError: hardhat_1.ethers.Wallet.fromMnemonic is not a function
    at Object.<anonymous> (/home/.../iden3/contracts/scripts/maintenance/multi-chain/checkIdTypes.ts:11:38)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module.m._compile (/home/.../iden3/contracts/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Object.require.extensions.<computed> [as .ts] (/home/.../iden3/contracts/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1024:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
    at node:internal/main/run_main_module:28:49

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