diff --git a/src/wallets/ethTransactions.js b/src/wallets/ethTransactions.js index 18196a80..606387ae 100644 --- a/src/wallets/ethTransactions.js +++ b/src/wallets/ethTransactions.js @@ -24,8 +24,10 @@ export const checkReceiptStatus = async (hash: string) => { } } +// export const calculateGasPrice = async () => '1000000000' + export const calculateGasPrice = async () => { -/* + /* const web3 = getWeb3() const { network } = web3.version const isMainnet = MAINNET_NETWORK === network @@ -33,9 +35,13 @@ export const calculateGasPrice = async () => { const url = isMainnet ? 'https://safe-relay.staging.gnosisdev.com/api/v1/gas-station/' : 'https://safe-relay.dev.gnosisdev.com/' -*/ + */ + const corsProblem = process.env.NODE_ENV === 'test' + if (corsProblem) { + return '4000000' + } - const response = await fetch('https://ethgasstation.info/json/ethgasAPI.json', { mode: 'cors' }) + const response = await fetch('https://ethgasstation.info/json/ethgasAPI.json') if (!response.ok) { throw new Error('Error querying gast station') }