We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have gone through all the hardhat tasks and have observed there are a few lines in each task that can be refactored. Those few lines are:
const privateKey = getPrivateKey(); const rpcProviderUrl = getProviderRpcUrl(blockchain); const provider = new providers.JsonRpcProvider(rpcProviderUrl); const wallet = new Wallet(privateKey); const signer = wallet.connect(provider);
In some tasks the rpcProviderUrl is named as sourceRpcProviderUrl and provider is named as sourceProvider.
rpcProviderUrl
sourceRpcProviderUrl
provider
sourceProvider
It is a matter of naming convention we can decide upon using only rpcProviderUrl and provider and refactor the above code into a function.
The function can either be called setup or accountAndNetworkSetup in a file namely setup.ts.
setup
accountAndNetworkSetup
setup.ts
This file then can be imported in almost all hardhat tasks and the function will be invoked instead of using the redundant 5 lines.
What this will do?
Please do let me know what you think about, if this sounds good, I can open a PR for the same. @andrejrakic @zeuslawyer
The text was updated successfully, but these errors were encountered:
Hey @balajipachai absolutely, go for it! Great suggestion, we'll be happy to assist if needed
Sorry, something went wrong.
Perfect , will make the changes and submit a PR!
No branches or pull requests
I have gone through all the hardhat tasks and have observed there are a few lines in each task that can be refactored.
Those few lines are:
In some tasks the
rpcProviderUrl
is named assourceRpcProviderUrl
andprovider
is named assourceProvider
.It is a matter of naming convention we can decide upon using only rpcProviderUrl and provider and refactor the above code into a function.
The function can either be called
setup
oraccountAndNetworkSetup
in a file namelysetup.ts
.This file then can be imported in almost all hardhat tasks and the function will be invoked instead of using the redundant 5 lines.
What this will do?
Please do let me know what you think about, if this sounds good, I can open a PR for the same.
@andrejrakic @zeuslawyer
The text was updated successfully, but these errors were encountered: