contracts icon indicating copy to clipboard operation
contracts copied to clipboard

feat(gre): add hardhat-secure-accounts to GRE

Open tmigone opened this issue 3 years ago • 1 comments
trafficstars

Motivation

Add hardhat-secure-accounts support to GRE.

Changes

Account management methods (getDeployer, getTestAccounts and getNamedAccounts) are now hooked up to hardhat-secure-accounts plugin by default. This can be disabled using the flag disableSecureAccounts, see GRE readme for more details.

Example:

// Without secure accounts
> const graph = hre.graph({ disableSecureAccounts: true })
> const deployer = await g.l1.getDeployer()
> deployer.address
'0xBc7f4d3a85B820fDB1058FD93073Eb6bc9AAF59b'


// With secure accounts
> const graph = hre.graph()
> const deployer = await g.l1.getDeployer()
== Using secure accounts, please unlock an account for L1(goerli)
Available accounts:  goerli-deployer, arbitrum-goerli-deployer, rinkeby-deployer, test-mnemonic
Choose an account to unlock (use tab to autocomplete): test-mnemonic
Enter the password for this account: ************
> deployer.address
'0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'

Note Shuffled the code a bit which makes this seem like a bigger change than it is. Renamed helpers/network.ts --> helpers/chain.ts and also added an unrelated helpers/network.ts which makes GitHub diff viewer to go wild.

tmigone avatar Aug 25 '22 20:08 tmigone

Codecov Report

Base: 90.57% // Head: 90.57% // No change to project coverage :thumbsup:

Coverage data is based on head (80aa99f) compared to base (3f16e5a). Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #696   +/-   ##
=======================================
  Coverage   90.57%   90.57%           
=======================================
  Files          35       35           
  Lines        1762     1762           
  Branches      296      296           
=======================================
  Hits         1596     1596           
  Misses        166      166           
Flag Coverage Δ
unittests 90.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Aug 25 '22 20:08 codecov[bot]

Fixed the error!

About the documentation reference, the GRE README.md mentions the plugin and links to it already, do you think we should add more?

tmigone avatar Oct 28 '22 19:10 tmigone