add VM type

pull/3094/head
yann300 7 years ago
parent e3efbed4c6
commit ab9a62afab
  1. 6
      src/execution-context.js

@ -95,6 +95,9 @@ function ExecutionContext () {
}
this.detectNetwork = function (callback) {
if (this.isVM()) {
callback(null, { id: '-', name: 'VM' })
} else {
this.web3().version.getNetwork((err, id) => {
var name = null
if (err) name = 'Unknown'
@ -104,10 +107,11 @@ function ExecutionContext () {
else if (id === '3') name = 'Ropsten'
else if (id === '4') name = 'Rinkeby'
else if (id === '42') name = 'Kovan'
else name = 'Unknown'
else name = 'Custom'
callback(err, { id, name })
})
}
}
this.internalWeb3 = function () {
return web3

Loading…
Cancel
Save