-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(networkConfig): remove 1 place where manual testing and code se…
…arching would be needed to add chains (#4857) ### Description we should try to maintain a status quo where all we have to do in every repo to add a chain is update a "NetworkId" enum and fix all compilation errors that result from it ### Test plan added spot checks for the two affected configs ### Related issues cc https://linear.app/valora/issue/ACT-1060/add-optimism-arbitrum-to-wallet ### Backwards compatibility na --------- Co-authored-by: Tom McGuire <Mcgtom10@gmail.com>
- Loading branch information
Showing
2 changed files
with
25 additions
and
19 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,18 @@ | ||
import { | ||
walletConnectChainIdToNetwork, | ||
walletConnectChainIdToNetworkId, | ||
} from 'src/web3/networkConfig' | ||
import { NetworkId, Network } from 'src/transactions/types' | ||
|
||
describe('networkConfig', () => { | ||
it('walletConnectChainIdToNetworkId spot checks', () => { | ||
// not attempting to check every value (too circular). just making sure inversion of networkIdToWalletConnectChainId is working as expected | ||
expect(walletConnectChainIdToNetworkId['eip155:42220']).toEqual(NetworkId['celo-mainnet']) | ||
expect(walletConnectChainIdToNetworkId['eip155:1']).toEqual(NetworkId['ethereum-mainnet']) | ||
}) | ||
it('walletConnectChainIdToNetwork spot checks', () => { | ||
// not checking every value (too circular), just testing the logic used to populate this object | ||
expect(walletConnectChainIdToNetwork['eip155:42220']).toEqual(Network.Celo) | ||
expect(walletConnectChainIdToNetwork['eip155:1']).toEqual(Network.Ethereum) | ||
}) | ||
}) |
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