Skip to content

Commit b76c3e8

Browse files
committed
transactionConfirmationBlocks to 1 + comments
1 parent fe3eab6 commit b76c3e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sendTx.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ const Web3 = require("web3");
22

33
const OPTIONS = {
44
defaultBlock: "latest",
5-
transactionConfirmationBlocks: 3,
5+
transactionConfirmationBlocks: 1,
66
transactionBlockTimeout: 5
77
};
88

99
const web3 = new Web3(
1010
new Web3.providers.WebsocketProvider("ws://localhost:8545"),
11+
// Web3.providers.HtttpProvider("http://localhost:8545")
1112
null,
1213
OPTIONS
1314
);
@@ -38,14 +39,13 @@ async function sendTx() {
3839
value: web3.utils.toWei("0.1", "ether")
3940
})
4041
.on("transactionHash", txHash => {
41-
//web3.currentProvider.send("evm_mine");
42+
//web3.currentProvider.send("evm_mine"); // execution of it seems to be blocked by sendTransaction in beta52
4243
console.log("on transactionHash", txHash);
4344
})
4445
.on("receipt", receipt => {
4546
console.log("on receipt");
4647
})
4748
.on("confirmation", (confirmationNumber, receipt) => {
48-
// ganache.advanceBlock(web3); // execution of it seems to be blocked by sendTransaction in beta52
4949
console.log("on confirmation", confirmationNumber);
5050
})
5151
.on("error", error => {

0 commit comments

Comments
 (0)