iov-core: Waiting on committed transaction hangs forever on error
I use this on the result of signAndPost
. It errors when the call errors, and resolved when the delivertx works, but when the delivertx errors, it never ends… no error is thrown.
Not sure if this an issue in ValueForUpdate.waitFor or that the updates on PostTx don’t contain errors.
// this waits for one commit to be writen, then returns the response
export async function waitForCommit(req: Promise<PostTxResponse>): Promise<PostTxResponse> {
const res = await req;
await res.blockInfo.waitFor(info => info.state === BcpTransactionState.InBlock);
return res;
}
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (16 by maintainers)
For the exact transaction search, we only need a single search-or-wait function, right? At least this is what postTx needs. Thus I propose