@@ -189,14 +188,16 @@ export class ExecutionContext {
...
@@ -189,14 +188,16 @@ export class ExecutionContext {
constoldProvider=web3.currentProvider
constoldProvider=web3.currentProvider
web3.setProvider(endpoint)
web3.setProvider(endpoint)
web3.eth.net.isListening((err,isConnected)=>{
web3.eth.net.isListening((err,isConnected)=>{
if(!err&&isConnected){
if(!err&&isConnected===true){
this.executionContext=context
this.executionContext=context
this._updateBlockGasLimit()
this._updateBlockGasLimit()
this.event.trigger('contextChanged',[context])
this.event.trigger('contextChanged',[context])
this.event.trigger('web3EndpointChanged')
this.event.trigger('web3EndpointChanged')
cb()
cb()
}elseif(isConnected==='canceled'){
web3.setProvider(oldProvider)
cb()
}else{
}else{
web3.setProvider(oldProvider)
web3.setProvider(oldProvider)
cb('Not possible to connect to the Web3 provider. Make sure the provider is running, a connection is open (via IPC or RPC) or that the provider plugin is properly configured.')
cb('Not possible to connect to the Web3 provider. Make sure the provider is running, a connection is open (via IPC or RPC) or that the provider plugin is properly configured.')