Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
test: Use 'mainnet' as networkName in onboard
Browse files Browse the repository at this point in the history
chore: Add remoteConfig for tests

fix: Declaration

Fix tests

chore: Update comment
  • Loading branch information
iamacook authored and katspaugh committed Dec 14, 2021
1 parent 1f5d4b7 commit e3a00c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/logic/safe/utils/mocks/remoteConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"features": [
"CONTRACT_INTERACTION",
"DOMAIN_LOOKUP",
"EIP1559",
"ERC721",
"SAFE_APPS",
"SAFE_TX_GAS_OPTIONAL"
Expand Down
8 changes: 7 additions & 1 deletion src/logic/wallets/onboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import { setWeb3 } from './getWeb3'
import { fetchProvider, removeProvider } from './store/actions'
import transactionDataCheck from './transactionDataCheck'
import { getSupportedWallets } from './utils/walletList'
import { ChainId, CHAIN_ID } from 'src/config/chain.d'

const NETWORK_NAMES: Record<ChainId, string> = {
[CHAIN_ID.ETHEREUM]: 'mainnet',
}

const getOnboardConfiguration = () => {
let lastUsedAddress = ''
Expand All @@ -15,7 +20,8 @@ const getOnboardConfiguration = () => {
return {
networkId: parseInt(_getChainId(), 10),
// Is it mandatory for Ledger to work to send network name in lowercase
networkName: getChainName().toLowerCase(),
// @FIXME: Move to CGW
networkName: NETWORK_NAMES[_getChainId()] || getChainName().toLowerCase(),
subscriptions: {
wallet: (wallet: Wallet) => {
if (wallet.provider) {
Expand Down

0 comments on commit e3a00c7

Please sign in to comment.