hashgraph / hedera-hardhat-hethers

DEPRECATED Hardhat plugin for integration with hethers.js.
Apache License 2.0
6 stars 0 forks source link

Compatibility with hardhat-deploy #28

Closed mshakeg closed 2 years ago

mshakeg commented 2 years ago

Problem

hardhat-deploy doesn't work with @hashgraph/hardhat-hethers. Attempting await deployments.fixtures() results in the following error stack trace:

TypeError: this.network.provider.send is not a function
      at DeploymentsManager.getChainId (node_modules/hardhat-deploy/src/DeploymentsManager.ts:443:51)
      at DeploymentsManager.loadDeployments (node_modules/hardhat-deploy/src/DeploymentsManager.ts:619:28)
      at DeploymentsManager.runDeploy (node_modules/hardhat-deploy/src/DeploymentsManager.ts:998:16)
      at Object.fixture (node_modules/hardhat-deploy/src/DeploymentsManager.ts:315:20)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async initialize (test/helpers.ts:40:3)
      at async Context.<anonymous> (test/_/Contract.test.ts:10:5)

Solution

Alternatives

No response

natanasow commented 2 years ago

Hi, @mshakeg,

The hardhat-deploy plugin, under the hood, uses etherjs and the etherjs provider (i.e. JSON RPC). On the other side, hethers doesn't implement the JSON RPC provider, so you can't use hardhat-deploy with hardhat-hethers out of the box. To use hardhat-deploy with hethers, we have to develop a hardhat-deploy-hedera plugin which core will interact with hethers instead of ethers.

Alternatively, you can use the hedera JSON RPC relay with ethers. That will fix most of your issues, and you will be able to interact hardhat-deploy without any concerns.

mshakeg commented 2 years ago

Hi @natanasow

Yeah, I managed to get it working a while back by setting up the relay in the hardhat networks config, however, forgot to close this issue. I do however think there are still issues with other hardhat plugins such as solidity-coverage.

natanasow commented 2 years ago

Yeah, that's possible, each plugin that uses ethersjs will not work correctly and must be rewritten with hethersjs.