contracts
contracts copied to clipboard
feat(gre): add convenience gre task creation method
Motivation
Each hardhat task that we add that uses GRE requires setting up the same parameters. This PR introduces a convenience method graphTask which is a drop in replacement for task but includes GRE related boilerplate.
// Before
import { task } from 'hardhat/config'
task('hello-world', 'Say hi!')
.addOptionalParam('addressBook', 'Path to the address book file.')
.addOptionalParam('graphConfig', 'Path to the graph config file for the network specified using --network.')
.addOptionalParam('l1GraphConfig', 'Path to the graph config file for the L1 network.')
.addOptionalParam('l2GraphConfig', 'Path to the graph config file for the L2 network.')
.setAction(async (args, hre) => {
console.log('hello world')
const graph = hre.graph(args)
})
// After
import { graphTask } from '../../gre/gre'
graphTask('hello-world', 'Say hi!')
.setAction((args, hre) => {
console.log('hello world')
const graph = hre.graph(args)
})
Signed-off-by: Tomás Migone [email protected]
Codecov Report
Base: 90.57% // Head: 90.57% // No change to project coverage :thumbsup:
Coverage data is based on head (
bbe0798) compared to base (b6219d3). Patch has no changes to coverable lines.
Additional details and impacted files
@@ Coverage Diff @@
## dev #724 +/- ##
=======================================
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.