diff --git a/lib/provider.js b/lib/provider.js index 133bce3475..8014fd3f33 100644 --- a/lib/provider.js +++ b/lib/provider.js @@ -111,7 +111,7 @@ Provider.prototype.send = function(payload, callback) { .join("\n < ") ); } - callback(response.error ? err : null, response); + process.nextTick(() => callback(response.error ? err : null, response)); }; if (self.options.verbose) { diff --git a/test/accounts.js b/test/accounts.js index a33599d864..625baf698c 100644 --- a/test/accounts.js +++ b/test/accounts.js @@ -43,18 +43,13 @@ describe("Accounts", function() { value: web3.utils.toWei(new BN(1), "ether"), gasLimit: 90000 }, - function(err, tx) { + function(err) { if (!err) { return done( new Error("We expected the account to be locked, which should throw an error when sending a transaction") ); } - assert( - err.message.toLowerCase().indexOf("could not unlock signer account") >= 0, - "Expected error message containing \"could not unlock signer account\" " + - "(case insensitive check). Received the following error message, instead. " + - `"${err.message}"` - ); + assert.strictEqual(err.message, "signer account is locked"); done(); } );