Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bb265d3b9 | ||
|
|
b940fad5e0 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
node_modules
|
||||
.env
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tx-manager",
|
||||
"version": "0.2.3",
|
||||
"version": "0.2.5",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -154,7 +154,6 @@ class Transaction {
|
||||
|
||||
this._emitter.emit('transactionHash', txHash)
|
||||
console.log(`Broadcasted transaction ${txHash}`)
|
||||
console.log(this.tx)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,6 +175,9 @@ class Transaction {
|
||||
this.currentTxHash = null
|
||||
continue
|
||||
}
|
||||
if (Number(receipt.status) === 0) {
|
||||
throw new Error('Transaction failed')
|
||||
}
|
||||
|
||||
const currentBlock = await this._provider.getBlockNumber()
|
||||
const confirmations = Math.max(0, currentBlock - receipt.blockNumber)
|
||||
@@ -235,7 +237,10 @@ class Transaction {
|
||||
}
|
||||
}
|
||||
|
||||
console.log('Mined. Start waiting for confirmations...')
|
||||
if (Number(receipt.status) === 0) {
|
||||
throw new Error('Transaction failed')
|
||||
}
|
||||
|
||||
this._emitter.emit('mined', receipt)
|
||||
this.currentTxHash = receipt.transactionHash
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user