Skip to content

Commit

Permalink
Merge pull request #81 from travis-payne/returning-hash-and-status
Browse files Browse the repository at this point in the history
Adding tx hash and status to sendTransactions return
  • Loading branch information
stefashkaa authored Dec 7, 2021
2 parents 1cbefd1 + 10befff commit f291711
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,17 @@ function sendTransactions (txs, txClient, timeoutLimit, requiredStatusesStr = [
.then(res => {
const status = res
.map(r => reverseEnum(TxStatus)[r.tx.getTxStatus()])
const hash = res
.map(r => r.tx.getTxHash())


return res.some(r => r.error)
? reject(
new Error(
`Command response error: expected=${requiredStatusesStr}, actual=${status}`
)
)
: resolve()
: resolve({ txHash: hash, status: status })
})
})
})
Expand Down

0 comments on commit f291711

Please sign in to comment.