code: function setProviderFromEndpoint (endpoint, context, cb) {
      var oldProvider = web3.currentProvider
  
      if (endpoint === 'ipc') {
        web3.setProvider(new web3.providers.IpcProvider())
      } else {
        web3.setProvider(new web3.providers.HttpProvider(endpoint))
      }
      if (web3.isConnected()) {
        executionContext = context
        self._updateBlockGasLimit()
        self.event.trigger('contextChanged', ['web3'])
        self.event.trigger('web3EndpointChanged')
        cb()
      } else {
        web3.setProvider(oldProvider)
        var alertMsg = 'Not possible to connect to the Web3 provider. '
        alertMsg += 'Make sure the provider is running and a connection is open (via IPC or RPC).'
        cb(alertMsg)
      }
    }
docs: TODO: not used here anymore and needs to be moved