Skip to content

Commit 2c8e5c5

Browse files
committed
do not apply default value to chain-id option
1 parent d3d4b26 commit 2c8e5c5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

evm/evm-typegen/src/chainIds.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,9 @@ export const CHAIN_IDS: Record<string, number> = {
292292
'plasma-testnet': 9746,
293293
}
294294

295-
export function chainIdOption(chainId?: string): number {
295+
export function chainIdOption(chainId?: string): number | undefined {
296296
if (chainId == null) {
297-
return 1
297+
return undefined
298298
}
299299

300300
// @ts-expect-error - chainId is a string

evm/evm-typegen/src/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ squid-evm-typegen src/abi 0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413#contract
7676
multicall?: boolean
7777
etherscanApi?: string
7878
etherscanApiKey?: string
79-
chainId: number
79+
chainId?: number
8080
etherscanChainId?: number
8181
}
8282
let dest = new OutDir(program.processedArgs[0])
@@ -119,7 +119,7 @@ async function read(
119119
spec: Spec,
120120
options: {
121121
etherscanApi?: string;
122-
chainId: number
122+
chainId?: number
123123
etherscanApiKey?: string,
124124
},
125125
): Promise<any> {
@@ -258,7 +258,7 @@ interface EtherscanAPIConfig {
258258
function getEtherscanAPIConfig(options: {
259259
etherscanApi?: string
260260
etherscanApiKey?: string
261-
chainId: number
261+
chainId?: number
262262
}): EtherscanAPIConfig {
263263
let api: string
264264
if (options.etherscanApi != null) {
@@ -272,7 +272,7 @@ function getEtherscanAPIConfig(options: {
272272
return {
273273
api,
274274
apiKey: options.etherscanApiKey || undefined,
275-
chainId: options.chainId,
275+
chainId: options.chainId ?? 1,
276276
}
277277
}
278278

0 commit comments

Comments
 (0)