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

Issue Running yarn test:deploy and Version Error with yarn install #127

Open
Ansellmo opened this issue Jan 9, 2024 · 2 comments
Open

Comments

@Ansellmo
Copy link

Ansellmo commented Jan 9, 2024

Hello,

I'm encountering an issue when running the yarn test:deploy command in my project. Below is the error message I receive:

yarn test:deploy
yarn run v1.22.21
$ pnpm deploy:prepare:fork && TEST_FORK=1 ./deployments/run-fork.sh HARDHAT_NETWORK=tenderly mocha --require hardhat/register --extension ts --recursive --exit --timeout 600000 --bail --no-exit 'deploy/tests/**/*.ts'

@bancor/[email protected] deploy:prepare:fork /home/user/carbon-contracts
rm -rf deployments/tenderly && cp -rf deployments/mainnet/. deployments/tenderly

Created a fork ID_TENDERLY_CENSOR at [PROJECT NAME]...

Running:

TENDERLY_FORK_ID=ID_TENDERLY_CENSOR HARDHAT_NETWORK=tenderly mocha --require hardhat/register --extension ts --recursive --exit --timeout 600000 --bail --no-exit deploy/tests/**/*.ts

...

1 failing

0100-revoke-roles
"before each" hook for "should revoke deployer roles":
ERROR processing /home/user/carbon-contracts/deploy/scripts/0100-revoke-roles.ts:
TypeError: hardhat_1.ethers.getContract is not a function
at execute (/home/user/carbon-contracts/utils/Deploy.ts:400:35)
at setRole (/home/user/carbon-contracts/utils/Deploy.ts:463:19)
at grantRole (/home/user/carbon-contracts/utils/Deploy.ts:471:59)
at Object.func (/home/user/carbon-contracts/deploy/scripts/0100-revoke-roles.ts:10:20)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async DeploymentsManager.executeDeployScripts (/home/user/carbon-contracts/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1226:22)
at async DeploymentsManager.runDeploy (/home/user/carbon-contracts/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1059:5)
Error: ERROR processing /home/user/carbon-contracts/deploy/scripts/0100-revoke-roles.ts:
TypeError: hardhat_1.ethers.getContract is not a function
at execute (utils/Deploy.ts:400:35)
at setRole (utils/Deploy.ts:463:19)
at grantRole (utils/Deploy.ts:471:59)
at Object.func (deploy/scripts/0100-revoke-roles.ts:10:20)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async DeploymentsManager.executeDeployScripts (node_modules/hardhat-deploy/src/DeploymentsManager.ts:1226:22)
at async DeploymentsManager.runDeploy (node_modules/hardhat-deploy/src/DeploymentsManager.ts:1059:5)
at DeploymentsManager.executeDeployScripts (node_modules/hardhat-deploy/src/DeploymentsManager.ts:1229:19)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async DeploymentsManager.runDeploy (node_modules/hardhat-deploy/src/DeploymentsManager.ts:1059:5)

Deleting a fork ID_TENDERLY_CENSOR from [PROJECT NAME]...

error Command failed with exit code 1.

Additionally, I am encountering a version error when running yarn install. Here is the output I receive:

yarn install v1.22.21
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
warning Lockfile has incorrect entry for "[email protected]". Ignoring it.
Couldn't find any versions for "parser" that matches "0.16"
? Please choose a version of "parser" from this list:
❯ 0.1.4
0.1.3
0.1.2
0.1.1
0.1.0

As a workaround, I have to use npm install --force instead of yarn install. I am running Ubuntu 22.04, and I have noticed that yarn test and yarn test:nightly commands work fine.

Any assistance or guidance on resolving these issues would be greatly appreciated.

Thank you.

@Ansellmo
Copy link
Author

Ansellmo commented Jan 9, 2024

And I am using master branch

@yudilevi
Copy link
Contributor

Hey,

Keep in mind we mainly use pnpm (as opposed to yarn), so you might want to try that.

In addition, try running pnpm deploy:prepare just in case - this will clean up and re-install node modules.

Did you ensure your local .env file is updated with all required values?

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

No branches or pull requests

2 participants