Skip to content

Commit 88398f3

Browse files
committed
fix: e2e bridge tests
1 parent 7596581 commit 88398f3

File tree

4 files changed

+45
-4
lines changed

4 files changed

+45
-4
lines changed

packages/contracts/e2e/deployment/config/l2/l2GNS.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { isGraphL2ChainId } from '@graphprotocol/sdk'
55

66
describe('[L2] GNS', () => {
77
const graph = hre.graph()
8-
const { L2GNS } = graph.contracts
8+
const { L2GNS } = graph.l2.contracts
99

1010
let unauthorized: SignerWithAddress
1111

packages/contracts/e2e/deployment/config/l2/l2Staking.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { isGraphL2ChainId } from '@graphprotocol/sdk'
55

66
describe('[L2] Staking', () => {
77
const graph = hre.graph()
8-
const { L2Staking } = graph.contracts
8+
const { L2Staking } = graph.l2.contracts
99

1010
let unauthorized: SignerWithAddress
1111

packages/contracts/tasks/bridge/configure.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ task(TASK_BRIDGE_CONFIGURE_L1, 'Configure L1 bridge')
3232
await configureL1Bridge(graph.contracts, governor, {
3333
l2GRTAddress: graph.l2.contracts.GraphToken.address,
3434
l2GRTGatewayAddress: graph.l2.contracts.L2GraphTokenGateway.address,
35+
l2GNSAddress: graph.l2.contracts.L2GNS.address,
36+
l2StakingAddress: graph.l2.contracts.L2Staking.address,
3537
arbAddressBookPath: taskArgs.arbitrumAddressBook,
3638
chainId: graph.chainId,
3739
})
@@ -60,6 +62,8 @@ task(TASK_BRIDGE_CONFIGURE_L2, 'Configure L2 bridge')
6062
await configureL2Bridge(graph.contracts, governor, {
6163
l1GRTAddress: graph.l1.contracts.GraphToken.address,
6264
l1GRTGatewayAddress: graph.l1.contracts.L1GraphTokenGateway.address,
65+
l1GNSAddress: graph.l1.contracts.L1GNS.address,
66+
l1StakingAddress: graph.l1.contracts.L1Staking.address,
6367
arbAddressBookPath: taskArgs.arbitrumAddressBook,
6468
chainId: graph.chainId,
6569
})

packages/sdk/src/deployments/network/actions/bridge-config.ts

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { SimpleAddressBook } from '../../lib/address-book'
66
export const configureL1Bridge: GraphNetworkAction<{
77
l2GRTAddress: string
88
l2GRTGatewayAddress: string
9+
l2GNSAddress: string
10+
l2StakingAddress: string
911
arbAddressBookPath: string
1012
chainId: number
1113
}> = async (
@@ -14,23 +16,27 @@ export const configureL1Bridge: GraphNetworkAction<{
1416
args: {
1517
l2GRTAddress: string
1618
l2GRTGatewayAddress: string
19+
l2GNSAddress: string
20+
l2StakingAddress: string
1721
arbAddressBookPath: string
1822
chainId: number
1923
},
2024
): Promise<void> => {
21-
const { l2GRTAddress, l2GRTGatewayAddress, arbAddressBookPath, chainId } = args
25+
const { l2GRTAddress, l2GRTGatewayAddress, l2GNSAddress, l2StakingAddress, arbAddressBookPath, chainId } = args
2226
console.info(`>>> Setting L1 Bridge Configuration <<<\n`)
2327

2428
const arbAddressBook = new SimpleAddressBook(arbAddressBookPath, chainId)
2529

2630
const gateway = contracts.L1GraphTokenGateway!
2731

32+
// Gateway
2833
console.info('L2 GRT address: ' + l2GRTAddress)
2934
await gateway.connect(signer).setL2TokenAddress(l2GRTAddress)
3035

3136
console.info('L2 Gateway address: ' + l2GRTGatewayAddress)
3237
await gateway.connect(signer).setL2CounterpartAddress(l2GRTGatewayAddress)
3338

39+
// Escrow
3440
const bridgeEscrow = contracts.BridgeEscrow!
3541
console.info('Escrow address: ' + bridgeEscrow.address)
3642
await gateway.connect(signer).setEscrowAddress(bridgeEscrow.address)
@@ -42,11 +48,27 @@ export const configureL1Bridge: GraphNetworkAction<{
4248
'L1 Inbox address: ' + l1Inbox.address + ' and L1 Router address: ' + l1Router.address,
4349
)
4450
await gateway.connect(signer).setArbitrumAddresses(l1Inbox.address, l1Router.address)
51+
52+
// GNS
53+
const gns = contracts.L1GNS!
54+
console.info('GNS address: ' + gns.address)
55+
console.info('L2 GNS address: ' + l2GNSAddress)
56+
await gns.connect(signer).setCounterpartGNSAddress(l2GNSAddress)
57+
await gateway.connect(signer).addToCallhookAllowlist(gns.address)
58+
59+
// Staking
60+
const staking = contracts.L1Staking!
61+
console.info('Staking address: ' + staking.address)
62+
console.info('L2 Staking address: ' + l2StakingAddress)
63+
await staking.connect(signer).setCounterpartStakingAddress(l2StakingAddress)
64+
await gateway.connect(signer).addToCallhookAllowlist(staking.address)
4565
}
4666

4767
export const configureL2Bridge: GraphNetworkAction<{
4868
l1GRTAddress: string
4969
l1GRTGatewayAddress: string
70+
l1GNSAddress: string
71+
l1StakingAddress: string
5072
arbAddressBookPath: string
5173
chainId: number
5274
}> = async (
@@ -55,18 +77,21 @@ export const configureL2Bridge: GraphNetworkAction<{
5577
args: {
5678
l1GRTAddress: string
5779
l1GRTGatewayAddress: string
80+
l1GNSAddress: string
81+
l1StakingAddress: string
5882
arbAddressBookPath: string
5983
chainId: number
6084
},
6185
): Promise<void> => {
62-
const { l1GRTAddress, l1GRTGatewayAddress, arbAddressBookPath, chainId } = args
86+
const { l1GRTAddress, l1GRTGatewayAddress, l1GNSAddress, l1StakingAddress, arbAddressBookPath, chainId } = args
6387
console.info(`>>> Setting L2 Bridge Configuration <<<\n`)
6488

6589
const arbAddressBook = new SimpleAddressBook(arbAddressBookPath, chainId)
6690

6791
const gateway = contracts.L2GraphTokenGateway!
6892
const token = contracts.L2GraphToken!
6993

94+
// Gateway
7095
console.info('L1 GRT address: ' + l1GRTAddress)
7196
await gateway.connect(signer).setL1TokenAddress(l1GRTAddress)
7297
await token.connect(signer).setL1Address(l1GRTAddress)
@@ -80,4 +105,16 @@ export const configureL2Bridge: GraphNetworkAction<{
80105

81106
console.info('L2 Gateway address: ' + gateway.address)
82107
await token.connect(signer).setGateway(gateway.address)
108+
109+
// GNS
110+
const gns = contracts.L2GNS!
111+
console.info('GNS address: ' + gns.address)
112+
console.info('L1 GNS address: ' + l1GNSAddress)
113+
await gns.connect(signer).setCounterpartGNSAddress(l1GNSAddress)
114+
115+
// Staking
116+
const staking = contracts.L2Staking!
117+
console.info('Staking address: ' + staking.address)
118+
console.info('L1 Staking address: ' + l1StakingAddress)
119+
await staking.connect(signer).setCounterpartStakingAddress(l1StakingAddress)
83120
}

0 commit comments

Comments
 (0)