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

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

Merged
merged 10 commits into from
Oct 28, 2022
Merged

Conversation

tmigone
Copy link
Contributor

@tmigone tmigone commented Aug 25, 2022

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 tmigone marked this pull request as draft August 25, 2022 20:31
@tmigone tmigone changed the base branch from dev to tmigone/gre-fix-hardhat August 25, 2022 20:31
@codecov
Copy link

codecov bot commented Aug 25, 2022

Codecov Report

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

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.

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

@tmigone tmigone requested a review from abarmat August 26, 2022 09:29
@tmigone tmigone marked this pull request as ready for review August 26, 2022 09:29
@tmigone tmigone changed the base branch from tmigone/gre-fix-hardhat to dev August 30, 2022 08:02
@tmigone tmigone changed the base branch from dev to tmigone/gre-fix-hardhat August 30, 2022 08:02
@tmigone tmigone changed the base branch from tmigone/gre-fix-hardhat to dev August 30, 2022 08:05
@tmigone tmigone changed the base branch from dev to tmigone/gre-fix-hardhat August 30, 2022 08:05
@tmigone tmigone force-pushed the tmigone/gre-secure-accounts branch from d100f70 to e269fb7 Compare August 30, 2022 08:10
@tmigone tmigone changed the base branch from tmigone/gre-fix-hardhat to dev August 30, 2022 08:11
@tmigone tmigone changed the title feat: add hardhat-secure-accounts to GRE feat(gre): add hardhat-secure-accounts to GRE Sep 22, 2022
@tmigone tmigone force-pushed the tmigone/gre-secure-accounts branch from 1aad5ae to 3d8c658 Compare September 22, 2022 17:16
@tmigone tmigone force-pushed the tmigone/gre-secure-accounts branch from 3d8c658 to c722334 Compare October 20, 2022 19:32
Copy link
Contributor

@abarmat abarmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd maybe add a reference to do the hh accounts new if they want to setup a new account so they don't need to look at the reference from the plugin.

The plugin is throwing an error when then accounts key in the hardhat.config.js entry for a network returns a string, which is a valid value as in remote

@@ -0,0 +1,7 @@
general:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change meant to happen here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes its for the test suite

@tmigone
Copy link
Contributor Author

tmigone commented Oct 28, 2022

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?

Copy link
Contributor

@abarmat abarmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works!

@tmigone tmigone merged commit 7e5ac05 into dev Oct 28, 2022
@tmigone tmigone deleted the tmigone/gre-secure-accounts branch October 28, 2022 19:57
abarmat added a commit that referenced this pull request Nov 23, 2022
- feat(gre): add hardhat-secure-accounts to GRE (#696)
- feat: add publish and mint to the CLI
- feat: refactor GRE to support L1 and L2 simultaneously
- fix: prevent underflow when subgraphs go under the minimum signal threshold
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

Successfully merging this pull request may close these issues.

2 participants