diff --git a/src/logic/wallets/ethTransactions.js b/src/logic/wallets/ethTransactions.js index 9f1ad16a..a26ca119 100644 --- a/src/logic/wallets/ethTransactions.js +++ b/src/logic/wallets/ethTransactions.js @@ -1,7 +1,7 @@ // @flow import { BigNumber } from 'bignumber.js' import axios from 'axios' -import { getWeb3, web3RO } from '~/logic/wallets/getWeb3' +import { getWeb3, web3ReadOnly } from '~/logic/wallets/getWeb3' // const MAINNET_NETWORK = 1 export const EMPTY_DATA = '0x' @@ -11,7 +11,7 @@ export const checkReceiptStatus = async (hash: string) => { return Promise.reject(new Error('No valid Tx hash to get receipt from')) } - const txReceipt = await web3RO.eth.getTransactionReceipt(hash) + const txReceipt = await web3ReadOnly.eth.getTransactionReceipt(hash) const { status } = txReceipt if (!status) { diff --git a/src/logic/wallets/getWeb3.js b/src/logic/wallets/getWeb3.js index 45075f24..1dd5edd4 100644 --- a/src/logic/wallets/getWeb3.js +++ b/src/logic/wallets/getWeb3.js @@ -64,15 +64,15 @@ const getInfuraUrl = () => { // With some wallets from web3connect you have to use their provider instance only for signing // And our own one to fetch data -export const web3RO = process.env.NODE_ENV !== 'test' +export const web3ReadOnly = process.env.NODE_ENV !== 'test' ? new Web3(new Web3.providers.HttpProvider(getInfuraUrl())) : new Web3(window.web3.currentProvider) -let web3 = web3RO +let web3 = web3ReadOnly export const getWeb3 = () => web3 export const resetWeb3 = () => { - web3 = web3RO + web3 = web3ReadOnly } const getProviderName: Function = (web3Provider): string => {