-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #889 from graphprotocol/mde/update-bridge-config
fix: add gns and staking counter part addresses when configuring bridge
- Loading branch information
Showing
8 changed files
with
203 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' | ||
import { expect } from 'chai' | ||
import hre from 'hardhat' | ||
import { isGraphL2ChainId } from '@graphprotocol/sdk' | ||
|
||
describe('[L1] GNS', () => { | ||
const graph = hre.graph() | ||
const { L1GNS, L1GraphTokenGateway } = graph.contracts | ||
|
||
let unauthorized: SignerWithAddress | ||
|
||
before(async function () { | ||
if (isGraphL2ChainId(graph.chainId)) this.skip() | ||
unauthorized = (await graph.getTestAccounts())[0] | ||
}) | ||
|
||
describe('L1GNS', () => { | ||
it('counterpartGNSAddress should match the L2GNS address', async () => { | ||
const l2GNS = await L1GNS.counterpartGNSAddress() | ||
expect(l2GNS).eq(graph.l2.contracts.L2GNS.address) | ||
}) | ||
|
||
it('should be added to callhookAllowlist', async () => { | ||
const isAllowed = await L1GraphTokenGateway.callhookAllowlist(L1GNS.address) | ||
expect(isAllowed).true | ||
}) | ||
}) | ||
}) |
30 changes: 30 additions & 0 deletions
30
packages/contracts/e2e/deployment/config/l1/l1Staking.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' | ||
import { expect } from 'chai' | ||
import hre from 'hardhat' | ||
import { isGraphL2ChainId } from '@graphprotocol/sdk' | ||
|
||
describe('[L1] Staking', () => { | ||
const graph = hre.graph() | ||
const { L1Staking, L1GraphTokenGateway } = graph.contracts | ||
|
||
let unauthorized: SignerWithAddress | ||
|
||
before(async function () { | ||
if (isGraphL2ChainId(graph.chainId)) this.skip() | ||
unauthorized = (await graph.getTestAccounts())[0] | ||
}) | ||
|
||
describe('L1Staking', () => { | ||
it('counterpartStakingAddress should match the L2Staking address', async () => { | ||
// counterpartStakingAddress is internal so we access the storage directly | ||
const l2StakingData = await hre.ethers.provider.getStorageAt(L1Staking.address, 24) | ||
const l2Staking = hre.ethers.utils.defaultAbiCoder.decode(['address'], l2StakingData)[0] | ||
expect(l2Staking).eq(graph.l2.contracts.L2Staking.address) | ||
}) | ||
|
||
it('should be added to callhookAllowlist', async () => { | ||
const isAllowed = await L1GraphTokenGateway.callhookAllowlist(L1Staking.address) | ||
expect(isAllowed).true | ||
}) | ||
}) | ||
}) |
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,23 @@ | ||
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' | ||
import { expect } from 'chai' | ||
import hre from 'hardhat' | ||
import { isGraphL1ChainId } from '@graphprotocol/sdk' | ||
|
||
describe('[L2] GNS', () => { | ||
const graph = hre.graph() | ||
const { L2GNS } = graph.l2.contracts | ||
|
||
let unauthorized: SignerWithAddress | ||
|
||
before(async function () { | ||
if (isGraphL1ChainId(graph.chainId)) this.skip() | ||
unauthorized = (await graph.getTestAccounts())[0] | ||
}) | ||
|
||
describe('L2GNS', () => { | ||
it('counterpartGNSAddress should match the L1GNS address', async () => { | ||
const l1GNS = await L2GNS.counterpartGNSAddress() | ||
expect(l1GNS).eq(graph.l1.contracts.L1GNS.address) | ||
}) | ||
}) | ||
}) |
25 changes: 25 additions & 0 deletions
25
packages/contracts/e2e/deployment/config/l2/l2Staking.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' | ||
import { expect } from 'chai' | ||
import hre from 'hardhat' | ||
import { isGraphL1ChainId } from '@graphprotocol/sdk' | ||
|
||
describe('[L2] Staking', () => { | ||
const graph = hre.graph() | ||
const { L2Staking } = graph.l2.contracts | ||
|
||
let unauthorized: SignerWithAddress | ||
|
||
before(async function () { | ||
if (isGraphL1ChainId(graph.chainId)) this.skip() | ||
unauthorized = (await graph.getTestAccounts())[0] | ||
}) | ||
|
||
describe('L2Staking', () => { | ||
it('counterpartStakingAddress should match the L1Staking address', async () => { | ||
// counterpartStakingAddress is internal so we access the storage directly | ||
const l1StakingData = await hre.ethers.provider.getStorageAt(L2Staking.address, 24) | ||
const l1Staking = hre.ethers.utils.defaultAbiCoder.decode(['address'], l1StakingData)[0] | ||
expect(l1Staking).eq(graph.l1.contracts.L1Staking.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
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