-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add account management methods to GRE (#645)
* feat: add account management methods to GRE Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
- Loading branch information
Showing
32 changed files
with
388 additions
and
152 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 was deleted.
Oops, something went wrong.
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,30 @@ | ||
import { expect } from 'chai' | ||
import hre from 'hardhat' | ||
import { NamedAccounts } from '../../../tasks/type-extensions' | ||
|
||
describe('AllocationExchange configuration', () => { | ||
const { | ||
contracts: { AllocationExchange }, | ||
getNamedAccounts, | ||
} = hre.graph() | ||
|
||
let namedAccounts: NamedAccounts | ||
|
||
before(async () => { | ||
namedAccounts = await getNamedAccounts() | ||
}) | ||
|
||
it('should be owned by allocationExchangeOwner', async function () { | ||
const owner = await AllocationExchange.governor() | ||
expect(owner).eq(namedAccounts.allocationExchangeOwner.address) | ||
}) | ||
|
||
it('should accept vouchers from authority', async function () { | ||
const allowed = await AllocationExchange.authority(namedAccounts.authority.address) | ||
expect(allowed).eq(true) | ||
}) | ||
|
||
// graphToken and staking are private variables so we can't verify | ||
it.skip('graphToken should match the GraphToken deployment address') | ||
it.skip('staking should match the Staking deployment address') | ||
}) |
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
4 changes: 2 additions & 2 deletions
4
e2e/deployment/curation.test.ts → e2e/deployment/config/curation.test.ts
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
4 changes: 2 additions & 2 deletions
4
e2e/deployment/disputeManager.test.ts → e2e/deployment/config/disputeManager.test.ts
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
4 changes: 2 additions & 2 deletions
4
e2e/deployment/epochManager.test.ts → e2e/deployment/config/epochManager.test.ts
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,21 @@ | ||
import { expect } from 'chai' | ||
import hre from 'hardhat' | ||
import { NamedAccounts } from '../../../tasks/type-extensions' | ||
|
||
describe('GraphProxyAdmin configuration', () => { | ||
const { | ||
contracts: { GraphProxyAdmin }, | ||
getNamedAccounts, | ||
} = hre.graph() | ||
|
||
let namedAccounts: NamedAccounts | ||
|
||
before(async () => { | ||
namedAccounts = await getNamedAccounts() | ||
}) | ||
|
||
it('should be owned by governor', async function () { | ||
const owner = await GraphProxyAdmin.governor() | ||
expect(owner).eq(namedAccounts.governor.address) | ||
}) | ||
}) |
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 { NamedAccounts } from '../../../tasks/type-extensions' | ||
|
||
describe('GraphToken configuration', () => { | ||
const { | ||
getNamedAccounts, | ||
contracts: { GraphToken, RewardsManager }, | ||
getDeployer, | ||
} = hre.graph() | ||
|
||
let namedAccounts: NamedAccounts | ||
|
||
before(async () => { | ||
namedAccounts = await getNamedAccounts() | ||
}) | ||
|
||
it('should be owned by governor', async function () { | ||
const owner = await GraphToken.governor() | ||
expect(owner).eq(namedAccounts.governor.address) | ||
}) | ||
|
||
it('deployer should not be minter', async function () { | ||
const deployer = await getDeployer() | ||
const deployerIsMinter = await GraphToken.isMinter(deployer.address) | ||
hre.network.config.chainId === 1337 ? this.skip() : expect(deployerIsMinter).eq(false) | ||
}) | ||
|
||
it('RewardsManager should be minter', async function () { | ||
const deployerIsMinter = await GraphToken.isMinter(RewardsManager.address) | ||
expect(deployerIsMinter).eq(true) | ||
}) | ||
}) |
2 changes: 1 addition & 1 deletion
2
e2e/deployment/protocol.ts → e2e/deployment/config/protocol.test.ts
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
2 changes: 1 addition & 1 deletion
2
e2e/deployment/serviceRegistry.test..ts → ...eployment/config/serviceRegistry.test..ts
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
4 changes: 2 additions & 2 deletions
4
e2e/deployment/staking.test.ts → e2e/deployment/config/staking.test.ts
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
Oops, something went wrong.