Skip to content

Commit d8fed24

Browse files
committed
fix(L1GraphTokenGateway): add a counterpartGateway getter for Router compatibility
1 parent caf5ab5 commit d8fed24

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

contracts/gateway/L1GraphTokenGateway.sol

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,16 @@ contract L1GraphTokenGateway is Initializable, GraphTokenGateway, L1ArbitrumMess
298298
return l2GRT;
299299
}
300300

301+
/**
302+
* @notice Get the address of the L2GraphTokenGateway
303+
* @dev This is added for compatibility with the Arbitrum Router's
304+
* gateway registration process.
305+
* @return Address of the L2 gateway connected to this gateway
306+
*/
307+
function counterpartGateway() external view returns (address) {
308+
return l2Counterpart;
309+
}
310+
301311
/**
302312
* @notice Creates calldata required to create a retryable ticket
303313
* @dev encodes the target function with its params which

test/gateway/l1GraphTokenGateway.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,15 @@ describe('L1GraphTokenGateway', () => {
178178
.setL2CounterpartAddress(mockL2Gateway.address)
179179
await expect(tx).revertedWith('Only Controller governor')
180180
})
181-
it('sets L2Counterpart', async function () {
181+
it('sets l2Counterpart which can be queried with counterpartGateway()', async function () {
182182
const tx = l1GraphTokenGateway
183183
.connect(governor.signer)
184184
.setL2CounterpartAddress(mockL2Gateway.address)
185185
await expect(tx)
186186
.emit(l1GraphTokenGateway, 'L2CounterpartAddressSet')
187187
.withArgs(mockL2Gateway.address)
188188
expect(await l1GraphTokenGateway.l2Counterpart()).eq(mockL2Gateway.address)
189+
expect(await l1GraphTokenGateway.counterpartGateway()).eq(mockL2Gateway.address)
189190
})
190191
})
191192
describe('setEscrowAddress', function () {

0 commit comments

Comments
 (0)