-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move
parentChainIsArbitrum
to separate file (#116)
- Loading branch information
1 parent
3f073a3
commit 1b0deb9
Showing
2 changed files
with
22 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import * as chains from './chains'; | ||
import { ParentChainId } from './types/ParentChain'; | ||
|
||
export function parentChainIsArbitrum(parentChainId: ParentChainId): boolean { | ||
// doing switch here to make sure it's exhaustive when checking against `ParentChainId` | ||
switch (parentChainId) { | ||
case chains.mainnet.id: | ||
case chains.base.id: | ||
case chains.sepolia.id: | ||
case chains.holesky.id: | ||
case chains.baseSepolia.id: | ||
case chains.nitroTestnodeL1.id: | ||
return false; | ||
|
||
case chains.arbitrumOne.id: | ||
case chains.arbitrumNova.id: | ||
case chains.arbitrumSepolia.id: | ||
case chains.nitroTestnodeL2.id: | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters