update provider on cancel

pull/1222/head
aniket-engg 4 years ago committed by Aniket
parent 8f90b540fb
commit bbd645decb
  1. 2
      apps/remix-ide/src/app.js
  2. 9
      apps/remix-ide/src/app/tabs/hardhat-provider.js
  3. 2
      apps/remix-ide/src/app/tabs/runTab/settings.js

@ -275,6 +275,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const networkModule = new NetworkModule(blockchain)
// ----------------- represent the current selected web3 provider ----
const web3Provider = new Web3ProviderModule(blockchain)
const hardhatProvider = new HardhatProvider(blockchain)
// ----------------- convert offset to line/column service -----------
const offsetToLineColumnConverter = new OffsetToLineColumnConverter()
registry.put({ api: offsetToLineColumnConverter, name: 'offsettolinecolumnconverter' })
@ -297,7 +298,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
makeUdapp(blockchain, compilersArtefacts, (domEl) => terminal.logHtml(domEl))
const contextualListener = new ContextualListener({ editor })
const hardhatProvider = new HardhatProvider()
engine.register([
contentImport,

@ -11,15 +11,16 @@ const profile = {
}
export default class HardhatProvider extends Plugin {
constructor () {
constructor (blockchain) {
super(profile)
this.provider = null
this.blockchain = blockchain
}
sendAsync (data) {
return new Promise((resolve, reject) => {
if (this.provider) {
this.provider[this.provider.sendAsync ? 'sendAsync' : 'send'](data, (error, message) => {
const provider = this.blockchain.web3().currentProvider
if (provider) {
provider[provider.sendAsync ? 'sendAsync' : 'send'](data, (error, message) => {
if (error) return reject(error)
resolve(message)
})

@ -294,7 +294,7 @@ class SettingsUI {
hardhatProviderDialogBody () {
return yo`
<div class="">
Hardhat Provider Endpoint
Hardhat JSON-RPC Endpoint
</div>
`
}

Loading…
Cancel
Save