Skip to content

Commit

Permalink
Fix chain ids in sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
perekopskiy committed Feb 2, 2022
1 parent 63964bf commit ce34d35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions sdk/zksync.js/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ export type Nonce = number | 'committed';
export type Network = 'localhost' | 'rinkeby' | 'ropsten' | 'mainnet' | 'rinkeby-beta' | 'ropsten-beta';

const MAINNET_NETWORK_CHAIN_ID = 1;
const RINKEBY_NETWORK_CHAIN_ID = 3;
const ROPSTEN_NETWROK_CHAIN_ID = 4;
const LOCALHOST_NETWROK_CHAIN_ID = 9;
const ROPSTEN_NETWORK_CHAIN_ID = 3;
const RINKEBY_NETWORK_CHAIN_ID = 4;
const LOCALHOST_NETWORK_CHAIN_ID = 9;

export function l1ChainId(network?: Network): number {
if (network === 'rinkeby' || network === 'rinkeby-beta') {
return RINKEBY_NETWORK_CHAIN_ID;
}
if (network === 'ropsten' || network === 'ropsten-beta') {
return ROPSTEN_NETWROK_CHAIN_ID;
return ROPSTEN_NETWORK_CHAIN_ID;
}
if (network === 'mainnet') {
return MAINNET_NETWORK_CHAIN_ID;
}
if (network === 'localhost') {
return LOCALHOST_NETWROK_CHAIN_ID;
return LOCALHOST_NETWORK_CHAIN_ID;
}
throw new Error('Unsupported netwrok');
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/zksync.js/tests/wallet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Wallet } from '../src/wallet';
import { getTokens } from 'reading-tool';

import { Provider } from '../src/provider';
import { Network } from '../build/types';
import { Network } from '../src/types';

describe('Wallet with mock provider', function () {
async function getWallet(ethPrivateKey: Uint8Array, network: Network): Promise<Wallet> {
Expand Down

0 comments on commit ce34d35

Please sign in to comment.