Commit f3281515 authored by yann300's avatar yann300

fix fork label & add comment

parent df76b5c5
...@@ -104,7 +104,7 @@ class SettingsUI { ...@@ -104,7 +104,7 @@ class SettingsUI {
</option> </option>
<option id="vm-mode-muirglacier" <option id="vm-mode-muirglacier"
title="Execution environment does not connect to any node, everything is local and in memory only." title="Execution environment does not connect to any node, everything is local and in memory only."
value="vm-istanbul" name="executionContext" fork="istanbul"> JavaScript VM (Istanbul) value="vm-istanbul" name="executionContext" fork="muirglacier"> JavaScript VM (Muirglacier)
</option> </option>
<option id="vm-mode-london" <option id="vm-mode-london"
title="Execution environment does not connect to any node, everything is local and in memory only." title="Execution environment does not connect to any node, everything is local and in memory only."
...@@ -245,9 +245,9 @@ class SettingsUI { ...@@ -245,9 +245,9 @@ class SettingsUI {
selectExEnv.addEventListener('change', (event) => { selectExEnv.addEventListener('change', (event) => {
const provider = selectExEnv.options[selectExEnv.selectedIndex] const provider = selectExEnv.options[selectExEnv.selectedIndex]
const fork = provider.getAttribute('fork') const fork = provider.getAttribute('fork') // can be undefined if connected to an external source (web3 provider / injected)
let context = provider.value let context = provider.value
context = context.startsWith('vm') ? 'vm' : context context = context.startsWith('vm') ? 'vm' : context // context has to be 'vm', 'web3' or 'injected'
this.setExecutionContext({ context, fork }) this.setExecutionContext({ context, fork })
}) })
...@@ -289,6 +289,10 @@ class SettingsUI { ...@@ -289,6 +289,10 @@ class SettingsUI {
` `
} }
/**
* generate a value used by the env dropdown list.
* @return {String} - can return 'vm-berlin, 'vm-london', 'injected' or 'web3'
*/
_getProviderDropdownValue () { _getProviderDropdownValue () {
const provider = this.blockchain.getProvider() const provider = this.blockchain.getProvider()
const fork = this.blockchain.getFork() const fork = this.blockchain.getFork()
......
...@@ -208,7 +208,10 @@ class Blockchain { ...@@ -208,7 +208,10 @@ class Blockchain {
return this.executionContext.getProvider() return this.executionContext.getProvider()
} }
getFork () { /**
* return the fork name applied to the current envionment
* @return {String} - fork name
*/
return this.executionContext.getCurrentFork() return this.executionContext.getCurrentFork()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment