Skip to content

Commit d8124cc

Browse files
committed
fix: L1/L2 specific contracts not being loaded
Signed-off-by: Tomás Migone <[email protected]>
1 parent 2516764 commit d8124cc

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

packages/common-ts/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.0.4-testnet] - 2022-11-09
8+
### Changed
9+
- Fix L1/L2 specific contracts not being loaded
10+
711
## [2.0.3-testnet] - 2022-11-09
812
### Changed
913
- Don't error out if contract is not deployed

packages/common-ts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphprotocol/common-ts",
3-
"version": "2.0.3-testnet",
3+
"version": "2.0.4-testnet",
44
"description": "Common TypeScript library for Graph Protocol components",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -16,7 +16,7 @@
1616
"test:watch": "jest --watch --passWithNoTests --detectOpenHandles --verbose"
1717
},
1818
"dependencies": {
19-
"@graphprotocol/contracts": "^2.0.0-testnet",
19+
"@graphprotocol/contracts": "l2-testnet",
2020
"@graphprotocol/pino-sentry-simple": "0.7.1",
2121
"@urql/core": "2.4.4",
2222
"@urql/exchange-execute": "1.2.2",

packages/common-ts/src/contracts/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export const connectContracts = async (
7373
): Promise<NetworkContracts> => {
7474
// eslint-disable-next-line @typescript-eslint/no-explicit-any
7575
const deployedContracts = (DEPLOYED_CONTRACTS as any)[`${chainId}`]
76-
7776
const GraphTokenFactory = GraphChain.isL1(chainId)
7877
? GraphToken__factory
7978
: L2GraphToken__factory
@@ -132,20 +131,20 @@ export const connectContracts = async (
132131
}
133132

134133
if (GraphChain.isL1(chainId)) {
135-
if (contracts.l1GraphTokenGateway) {
134+
if (deployedContracts.L1GraphTokenGateway) {
136135
contracts.l1GraphTokenGateway = L1GraphTokenGateway__factory.connect(
137136
deployedContracts.L1GraphTokenGateway.address,
138137
providerOrSigner,
139138
)
140139
}
141-
if (contracts.bridgeEscrow) {
140+
if (deployedContracts.BridgeEscrow) {
142141
contracts.bridgeEscrow = BridgeEscrow__factory.connect(
143142
deployedContracts.BridgeEscrow.address,
144143
providerOrSigner,
145144
)
146145
}
147146
} else if (GraphChain.isL2(chainId)) {
148-
if (contracts.l2GraphTokenGateway) {
147+
if (deployedContracts.L2GraphTokenGateway) {
149148
contracts.l2GraphTokenGateway = L2GraphTokenGateway__factory.connect(
150149
deployedContracts.L2GraphTokenGateway.address,
151150
providerOrSigner,

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@
647647
resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
648648
integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==
649649

650-
"@graphprotocol/contracts@^2.0.0-testnet":
650+
"@graphprotocol/contracts@l2-testnet":
651651
version "2.0.0-testnet"
652652
resolved "https://registry.yarnpkg.com/@graphprotocol/contracts/-/contracts-2.0.0-testnet.tgz#95f3156a03bffc754f523240bf47801a4cbc7eca"
653653
integrity sha512-ZJ/dxGeSnN4cFI7HGUcU2HBe7hZtNat/5UX2B4f27sQyfV9IJBcXy+6wBugn97rmZFPGj3yk7K1PMvJVVOFKpA==

0 commit comments

Comments
 (0)