Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Ensure eth_sendTransaction is fully asynchronous (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmurdoch committed Feb 1, 2019
1 parent 02bf9e7 commit e1d184d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
9 changes: 2 additions & 7 deletions test/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
);
Expand Down

0 comments on commit e1d184d

Please sign in to comment.