pull/3951/head
Oleksii Kosynskyi 2 years ago
parent 28ca150d1c
commit 2b2fd77be3
No known key found for this signature in database
GPG Key ID: B4A8D3CCE22EA65E
  1. 8
      apps/remix-ide/src/blockchain/providers/vm.ts

@ -14,6 +14,7 @@ export class VMProvider {
newAccountCallback: {[stamp: number]: (error: Error, address: string) => void} newAccountCallback: {[stamp: number]: (error: Error, address: string) => void}
constructor (executionContext: ExecutionContext) { constructor (executionContext: ExecutionContext) {
this.executionContext = executionContext this.executionContext = executionContext
this.worker = null this.worker = null
this.provider = null this.provider = null
@ -23,7 +24,10 @@ export class VMProvider {
getAccounts (cb) { getAccounts (cb) {
this.web3.eth.getAccounts() this.web3.eth.getAccounts()
.then(accounts => cb(null, accounts)) .then(accounts => cb(null, accounts))
.catch(err => cb('No accounts?')) .catch(err => {
console.log('err',err)
cb('No accounts?')
})
} }
async resetEnvironment () { async resetEnvironment () {
@ -42,6 +46,8 @@ export class VMProvider {
if (!msg.data.error) { if (!msg.data.error) {
this.provider = { this.provider = {
sendAsync: (query, callback) => { sendAsync: (query, callback) => {
console.log('query',query)
console.log('callback',callback)
const stamp = Date.now() + incr const stamp = Date.now() + incr
incr++ incr++
stamps[stamp] = callback stamps[stamp] = callback

Loading…
Cancel
Save