Fixs getProviderInfo usage

This commit is contained in:
Agustin Pane 2020-07-08 10:26:33 -03:00
parent 8fd252d1a7
commit 7458eb0957
3 changed files with 5 additions and 4 deletions

View File

@ -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<void> => {
const web3 = getWeb3()
const providerInfo = await getProviderInfo(web3, providerName)
const providerInfo = await getProviderInfo(web3.currentProvider, providerName)
await handleProviderNotification(providerInfo, dispatch)
processProviderResponse(dispatch, providerInfo)
}

View File

@ -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

View File

@ -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))