diff --git a/src/logic/wallets/store/actions/fetchProvider.ts b/src/logic/wallets/store/actions/fetchProvider.ts index 1d3006ab..f2ffbadc 100644 --- a/src/logic/wallets/store/actions/fetchProvider.ts +++ b/src/logic/wallets/store/actions/fetchProvider.ts @@ -8,6 +8,7 @@ import enqueueSnackbar from 'src/logic/notifications/store/actions/enqueueSnackb import { ETHEREUM_NETWORK, ETHEREUM_NETWORK_IDS, getProviderInfo, getWeb3 } from 'src/logic/wallets/getWeb3' import { makeProvider } from 'src/logic/wallets/store/model/provider' import { updateStoredTransactionsStatus } from 'src/routes/safe/store/actions/transactions/utils/transactionHelpers' +import { Dispatch } from 'redux' export const processProviderResponse = (dispatch, provider) => { const walletRecord = makeProvider(provider) @@ -48,9 +49,9 @@ const handleProviderNotification = (provider, dispatch) => { } } -export default (providerName) => async (dispatch) => { +export default (providerName: string) => async (dispatch: Dispatch): Promise => { const web3 = getWeb3() - const providerInfo = await getProviderInfo(web3, providerName) + const providerInfo = await getProviderInfo(web3.currentProvider, providerName) await handleProviderNotification(providerInfo, dispatch) processProviderResponse(dispatch, providerInfo) } diff --git a/src/logic/wallets/store/middlewares/providerWatcher.ts b/src/logic/wallets/store/middlewares/providerWatcher.ts index 0dedb32d..3fe97e8b 100644 --- a/src/logic/wallets/store/middlewares/providerWatcher.ts +++ b/src/logic/wallets/store/middlewares/providerWatcher.ts @@ -37,7 +37,7 @@ const providerWatcherMware = (store) => (next) => async (action) => { watcherInterval = setInterval(async () => { const web3 = getWeb3() - const providerInfo = await getProviderInfo(web3) + const providerInfo = await getProviderInfo(web3.currentProvider) const networkChanged = currentProviderProps.network !== providerInfo.network diff --git a/src/test/safe.dom.create.tsx b/src/test/safe.dom.create.tsx index 42da3ad5..58095ac8 100644 --- a/src/test/safe.dom.create.tsx +++ b/src/test/safe.dom.create.tsx @@ -31,7 +31,7 @@ afterAll(() => { }) const renderOpenSafeForm = async (localStore) => { - const provider = await getProviderInfo((window as any).web3.currentProvider) + const provider = await getProviderInfo(window.web3.currentProvider) const walletRecord = makeProvider(provider) localStore.dispatch(addProvider(walletRecord))