rename web3ro to web3ReadOnly because RO meaning not easy to understand

This commit is contained in:
Mikhail Mikheev 2019-11-08 14:15:06 +04:00
parent b2c72f9097
commit c2a7463236
2 changed files with 5 additions and 5 deletions

View File

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

View File

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