Merge pull request #754 from embark-framework/bug_fix/await-hang

Fix hang by not intercepting web3 transactions
This commit is contained in:
Iuri Matias 2018-08-31 08:54:42 -04:00 committed by GitHub
commit f63f10f4c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -80,8 +80,8 @@ class CodeRunner {
this.ipc.broadcast("runcode:newCommand", {code}); this.ipc.broadcast("runcode:newCommand", {code});
} }
if (result instanceof Promise) { if (result instanceof Promise && !result.on) {
return result.then((value) => cb(null, value)).catch(cb); return result.then((value) => { cb(null, value); }).catch(cb);
} }
cb(null, result); cb(null, result);

View File

@ -23,7 +23,6 @@ contract("SimpleStorage", function () {
}); });
it("set storage value", function (done) { it("set storage value", function (done) {
// await SimpleStorage.methods.set(150).send();
Utils.secureSend(web3, SimpleStorage.methods.set(150), {}, false, async function(err) { Utils.secureSend(web3, SimpleStorage.methods.set(150), {}, false, async function(err) {
if (err) { if (err) {
return done(err); return done(err);