Skip to content

Commit

Permalink
Merge branch 'main' into fix-ci-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenbf authored Aug 8, 2023
2 parents 59a32c0 + 6047bd3 commit 1a0803b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/common/src/GRPCClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,17 +528,19 @@ export class ConcordiumGRPCClient {
}, timeoutTime);
}

const blockStream = this.getFinalizedBlocks(abortController.signal);

const response = await this.getBlockItemStatus(transactionHash);
if (response.status === 'finalized') {
// Simply doing `abortController.abort()` causes an error.
// See: https://github.com/grpc/grpc-node/issues/1652
setTimeout(() => abortController.abort(), 0);
return resolve(response.outcome);
}

try {
const blockStream = this.getFinalizedBlocks(
abortController.signal
);

const response = await this.getBlockItemStatus(transactionHash);
if (response.status === 'finalized') {
// Simply doing `abortController.abort()` causes an error.
// See: https://github.com/grpc/grpc-node/issues/1652
setTimeout(() => abortController.abort(), 0);
return resolve(response.outcome);
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
for await (const _ of blockStream) {
const response = await this.getBlockItemStatus(
Expand Down

0 comments on commit 1a0803b

Please sign in to comment.