pull/5370/head
Aniket-Engg 2 years ago committed by Aniket
parent 3ad9809e8d
commit a0ee033a52
  1. 10
      libs/remix-ui/run-tab/src/lib/actions/deploy.ts
  2. 10
      libs/remix-ui/run-tab/src/lib/actions/index.ts

@ -300,4 +300,14 @@ export const runTransactions = (
export const getFuncABIInputs = (plugin: RunTab, funcABI: FuncABI) => {
return plugin.blockchain.getInputs(funcABI)
}
export const updateInstanceBalance = (plugin: RunTab) => {
if (plugin.REACT_API?.instances?.instanceList?.length) {
for (const instance of plugin.REACT_API.instances.instanceList) {
plugin.blockchain.getBalanceInEther(instance.address, (err, balInEth) => {
if (!err) instance.balance = balInEth
})
}
}
}

@ -6,7 +6,7 @@ import { createNewBlockchainAccount, fillAccountsList, setExecutionContext, sign
import { clearInstances, clearPopUp, removeInstance, setAccount, setGasFee, setMatchPassphrasePrompt,
setNetworkNameFromProvider, setPassphrasePrompt, setSelectedContract, setSendTransactionValue, setUnit,
updateBaseFeePerGas, updateConfirmSettings, updateGasPrice, updateGasPriceStatus, updateMaxFee, updateMaxPriorityFee, updateScenarioPath, updateTxFeeContent } from './actions'
import { createInstance, getContext, getFuncABIInputs, getSelectedContract, loadAddress, runTransactions } from './deploy'
import { createInstance, getContext, getFuncABIInputs, getSelectedContract, loadAddress, runTransactions, updateInstanceBalance } from './deploy'
import { CompilerAbstract as CompilerAbstractType } from '@remix-project/remix-solidity-ts'
import { ContractData, FuncABI } from "@remix-project/core-plugin"
import { DeployMode, MainnetPrompt } from '../types'
@ -28,13 +28,7 @@ export const initRunTab = (udapp: RunTab) => async (reducerDispatch: React.Dispa
setupEvents(plugin, dispatch)
setInterval(() => {
fillAccountsList(plugin, dispatch)
if (plugin.REACT_API?.instances?.instanceList?.length){
for (const instance of plugin.REACT_API.instances.instanceList) {
plugin.blockchain.getBalanceInEther(instance.address, (err, balInEth) => {
if (!err) instance.balance = balInEth
})
}
}
updateInstanceBalance(plugin)
}, 1000)
}

Loading…
Cancel
Save