ccip-starter-kit-hardhat
ccip-starter-kit-hardhat copied to clipboard
Refactors hardhat tasks code, makes it compact & increases code readability
Description
Same as that of mentioned in #8
-
Adds
getSigner
,getProvider
&getSignerAndProvider
intasks/utils.ts
- The functions
getSigner
,getProvider
internally callsgetSignerAndProvider
, since one function should do one job. There are instances in the codebase wherein, sometimes, only the signer is needed and sometimes only the provider is needed and sometimes both are needed, thus, the above 3 different functions.
- The functions
-
Having
hre.network.name
was redundant and was impacting the code readbility, hence, created a variableconst blockchainNetwork = hre.network.name
- And replaced all occurences of
hre.network.name
withblockchainNetwork
.
- And replaced all occurences of
-
@zeuslawyer @andrejrakic As discussed in #8, I did gave a thought about creating a new file
setup.ts
and having a functionaccountAndNetworkSetup
, however, once I went through all the tasks, havinggetSigner, getProvider & getSignerAndProvider
inutils.ts
made more sense, thus, proposing this PR accordingly.
Closes
#8
Please do let me know in case of any improvements/suggestions/feedbacks.
Happy to help and contribute for open source learning!