fix bug for non-metamask view

This commit is contained in:
Roman Storm 2020-12-18 00:01:44 -08:00
parent 18a2da5082
commit 2b6c0a8ba4
No known key found for this signature in database
GPG Key ID: 522F2A785F34E71F
2 changed files with 7 additions and 2 deletions

View File

@ -9,7 +9,7 @@ const state = () => {
const getters = {
deployerContract: (state, getters, rootState, rootGetters) => (isProxy) => {
const web3 = rootGetters['provider/getWeb3']
const web3 = rootGetters['provider/currentRpc']
return new web3.eth.Contract(
deployerABI,
isProxy
@ -30,7 +30,7 @@ const actions = {
dispatch('loading/enable', {}, { root: true })
const isProxy = action.domain === 'deployer.contract.tornadocash.eth'
const ethAccount = rootGetters['provider/getAccount']
const web3 = rootGetters['provider/getWeb3']
const web3 = rootGetters['provider/currentRpc']
const code = await web3.eth.getCode(action.expectedAddress)
console.log('code', code)

View File

@ -26,6 +26,11 @@ export default {
return Object.freeze(new Web3(provider))
},
currentRpc: (state, getters) => {
const network = getters.getNetwork
const rpcUrl = network.rpcUrls.Infura.url
return Object.freeze(new Web3(rpcUrl))
},
getBalance: (state) => {
return state.balance
},