|
|
|
@ -244,16 +244,29 @@ class SettingsUI { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
setExecutionContext (context) { |
|
|
|
|
this.blockchain.changeExecutionContext(context, () => { |
|
|
|
|
modalDialogCustom.prompt('External node request', this.web3ProviderDialogBody(), 'http://127.0.0.1:8545', (target) => { |
|
|
|
|
this.blockchain.setProviderFromEndpoint(target, context, (alertMsg) => { |
|
|
|
|
if (alertMsg) addTooltip(alertMsg) |
|
|
|
|
this.setFinalContext() |
|
|
|
|
}) |
|
|
|
|
if (context === 'Hardhat Provider') { |
|
|
|
|
this.blockchain.changeExecutionContext(context, () => { |
|
|
|
|
modalDialogCustom.prompt('Hardhat node request', this.hardhatProviderDialogBody(), 'http://127.0.0.1:8545', (target) => { |
|
|
|
|
this.blockchain.setProviderFromEndpoint(target, context, (alertMsg) => { |
|
|
|
|
if (alertMsg) addTooltip(alertMsg) |
|
|
|
|
this.setFinalContext() |
|
|
|
|
}) |
|
|
|
|
}, this.setFinalContext.bind(this)) |
|
|
|
|
}, (alertMsg) => { |
|
|
|
|
addTooltip(alertMsg) |
|
|
|
|
}, this.setFinalContext.bind(this)) |
|
|
|
|
} else { |
|
|
|
|
this.blockchain.changeExecutionContext(context, () => { |
|
|
|
|
modalDialogCustom.prompt('External node request', this.web3ProviderDialogBody(), 'http://127.0.0.1:8545', (target) => { |
|
|
|
|
this.blockchain.setProviderFromEndpoint(target, context, (alertMsg) => { |
|
|
|
|
if (alertMsg) addTooltip(alertMsg) |
|
|
|
|
this.setFinalContext() |
|
|
|
|
}) |
|
|
|
|
}, this.setFinalContext.bind(this)) |
|
|
|
|
}, (alertMsg) => { |
|
|
|
|
addTooltip(alertMsg) |
|
|
|
|
}, this.setFinalContext.bind(this)) |
|
|
|
|
}, (alertMsg) => { |
|
|
|
|
addTooltip(alertMsg) |
|
|
|
|
}, this.setFinalContext.bind(this)) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
web3ProviderDialogBody () { |
|
|
|
@ -278,6 +291,14 @@ class SettingsUI { |
|
|
|
|
` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
hardhatProviderDialogBody () { |
|
|
|
|
return yo` |
|
|
|
|
<div class=""> |
|
|
|
|
Hardhat Provider Endpoint |
|
|
|
|
</div> |
|
|
|
|
` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
setFinalContext () { |
|
|
|
|
// set the final context. Cause it is possible that this is not the one we've originaly selected
|
|
|
|
|
this.selectExEnv.value = this.blockchain.getProvider() |
|
|
|
|