-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adjust gre, e2e and configs to account for reservoirs
- Loading branch information
1 parent
53e0a80
commit 559ea00
Showing
12 changed files
with
140 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { expect } from 'chai' | ||
import hre from 'hardhat' | ||
import GraphChain from '../../../../gre/helpers/network' | ||
import { getItemValue } from '../../../../cli/config' | ||
|
||
describe('[L1] L1Reservoir configuration', () => { | ||
const graph = hre.graph() | ||
const { graphConfig } = graph | ||
const { L1Reservoir, Controller, GraphToken, RewardsManager } = graph.contracts | ||
|
||
before(async function () { | ||
if (GraphChain.isL2(graph.chainId)) this.skip() | ||
}) | ||
|
||
it('should be controlled by Controller', async function () { | ||
const controller = await L1Reservoir.controller() | ||
expect(controller).eq(Controller.address) | ||
}) | ||
|
||
it('should have a snapshot of the total supply', async function () { | ||
expect(await L1Reservoir.issuanceBase()).eq(await GraphToken.totalSupply()) | ||
}) | ||
|
||
it('should have issuanceRate set to zero', async function () { | ||
expect(await L1Reservoir.issuanceRate()).eq(0) | ||
}) | ||
|
||
it('should have dripInterval set from config', async function () { | ||
const value = await L1Reservoir.dripInterval() | ||
const expected = getItemValue(graphConfig, 'contracts/L1Reservoir/init/dripInterval') | ||
expect(value).eq(expected) | ||
}) | ||
|
||
it('should have RewardsManager approved for the max GRT amount', async function () { | ||
expect(await GraphToken.allowance(L1Reservoir.address, RewardsManager.address)).eq( | ||
hre.ethers.constants.MaxUint256, | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { expect } from 'chai' | ||
import hre from 'hardhat' | ||
import GraphChain from '../../../../gre/helpers/network' | ||
import { getItemValue } from '../../../../cli/config' | ||
|
||
describe('[L2] L2Reservoir configuration', () => { | ||
const graph = hre.graph() | ||
const { graphConfig } = graph | ||
const { L2Reservoir, Controller, GraphToken, RewardsManager } = graph.contracts | ||
|
||
before(async function () { | ||
if (GraphChain.isL1(graph.chainId)) this.skip() | ||
}) | ||
|
||
it('should be controlled by Controller', async function () { | ||
const controller = await L2Reservoir.controller() | ||
expect(controller).eq(Controller.address) | ||
}) | ||
|
||
it('should have issuanceBase set to zero', async function () { | ||
expect(await L2Reservoir.issuanceBase()).eq(0) | ||
}) | ||
|
||
it('should have issuanceRate set to zero', async function () { | ||
expect(await L2Reservoir.issuanceRate()).eq(0) | ||
}) | ||
|
||
it('should have RewardsManager approved for the max GRT amount', async function () { | ||
expect(await GraphToken.allowance(L2Reservoir.address, RewardsManager.address)).eq( | ||
hre.ethers.constants.MaxUint256, | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters