Skip to content

Commit 10befff

Browse files
author
Travis Payne
committed
Adding tx hash and status to sendTransactions return
Signed-off-by: Travis Payne <travis.payne@accenture.com>
1 parent 1cbefd1 commit 10befff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/util.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,17 @@ function sendTransactions (txs, txClient, timeoutLimit, requiredStatusesStr = [
117117
.then(res => {
118118
const status = res
119119
.map(r => reverseEnum(TxStatus)[r.tx.getTxStatus()])
120+
const hash = res
121+
.map(r => r.tx.getTxHash())
122+
120123

121124
return res.some(r => r.error)
122125
? reject(
123126
new Error(
124127
`Command response error: expected=${requiredStatusesStr}, actual=${status}`
125128
)
126129
)
127-
: resolve()
130+
: resolve({ txHash: hash, status: status })
128131
})
129132
})
130133
})

0 commit comments

Comments
 (0)