Skip to content

Commit

Permalink
fixes module error
Browse files Browse the repository at this point in the history
  • Loading branch information
douglance committed Sep 15, 2023
1 parent 9e3d18b commit 2c360d0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/utils/__test__/__mocks__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const rollupConfig = {
futureSeconds: 3600,
},
};
export const parentChainId = 421613;

export const rollupContracts = {
rollup: '0x389a3eA93AcF8D3d9cE09008Db3b19b15D3698f0',
Expand Down
2 changes: 2 additions & 0 deletions src/utils/__test__/__snapshots__/configBuilders.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ exports[`Configuration Builders buildL3Config Function builds correctly 1`] = `
"minL2BaseFee": 100000000,
"networkFeeReceiver": "0xF27c2fEfe6a39aa08763e504b44133CD992dd0f3",
"outbox": "0x5B8674639103E827d124a70CD1d48d3E59F41188",
"parent-chain-node-url": "https://goerli-rollup.arbitrum.io/rpc",
"parentChainId": 421613,
"rollup": "0x389a3eA93AcF8D3d9cE09008Db3b19b15D3698f0",
"sequencerInbox": "0x3d8d87d6280cA15f54dBF18151582E67F421576A",
"staker": "0xF27c2fEfe6a39aa08763e504b44133CD992dd0f3",
Expand Down
6 changes: 5 additions & 1 deletion src/utils/__test__/configBuilders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
buildAnyTrustNodeConfig,
buildL3Config,
} from '../configBuilders';
import { rollupConfig, rollupContracts, validators, batchPoster } from './__mocks__';
import { rollupConfig, rollupContracts, validators, batchPoster, parentChainId } from './__mocks__';

describe('Configuration Builders', () => {
describe('buildChainConfig Function', () => {
Expand All @@ -22,6 +22,7 @@ describe('Configuration Builders', () => {
rollupContracts,
validators,
batchPoster,
parentChainId,
});
expect(result).toMatchSnapshot();
});
Expand All @@ -44,10 +45,12 @@ describe('Configuration Builders', () => {
rollupContracts,
validators,
batchPoster,
parentChainId,
});
const result = buildAnyTrustNodeConfig(
rollupConfigData,
'0xF27c2fEfe6a39aa08763e504b44133CD992dd0f3',
parentChainId,
);
expect(result).toMatchSnapshot();
});
Expand All @@ -61,6 +64,7 @@ describe('Configuration Builders', () => {
validators,
batchPoster,
rollupContracts,
parentChainId,
};
const result = await buildL3Config(buildL3ConfigParams);
expect(result).toMatchSnapshot();
Expand Down
10 changes: 4 additions & 6 deletions src/utils/getRpcUrl.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { goerli, sepolia } from 'wagmi/chains';

import { ChainId } from '@/types/ChainId';

export function getRpcUrl(chainId: number) {
switch (chainId) {
case goerli.id:
return goerli.rpcUrls.default.http[0];
case 5:
return 'https://rpc.ankr.com/eth_goerli';

case sepolia.id:
return sepolia.rpcUrls.default.http[0];
case 11155111:
return 'https://rpc.sepolia.org';

case ChainId.ArbitrumGoerli:
return 'https://goerli-rollup.arbitrum.io/rpc';
Expand Down

0 comments on commit 2c360d0

Please sign in to comment.