fix receipt in notifyTransaction
@@ -107,20 +107,20 @@ export class Provider {
);
});
} else {
- let notifyDone = false;
- while (!notifyDone) {
+ while (true) {
const priorOpStatus = await this.getPriorityOpStatus(serialId);
- if (priorOpStatus.block) {
- if (action == "COMMIT") {
- notifyDone = priorOpStatus.block.committed;
+ const notifyDone
+ = action == "COMMIT"
+ ? priorOpStatus.block && priorOpStatus.block.committed
+ : priorOpStatus.block && priorOpStatus.block.verified;
+ if (notifyDone) {
+ return priorOpStatus;
} else {
- notifyDone = priorOpStatus.block.verified;
- }
- }
await sleep(3000);
}
}
}
+ }
async notifyTransaction(
hash: string,
@@ -139,20 +139,20 @@ export class Provider {
);
});
} else {
- let notifyDone = false;
- while (!notifyDone) {
+ while (true) {
const transactionStatus = await this.getTxReceipt(hash);
- if (transactionStatus.block) {
- if (action == "COMMIT") {
- notifyDone = transactionStatus.block.committed;
+ const notifyDone
+ = action == "COMMIT"
+ ? transactionStatus.block && transactionStatus.block.committed
+ : transactionStatus.block && transactionStatus.block.verified;
+ if (notifyDone) {
+ return transactionStatus;
} else {
- notifyDone = transactionStatus.block.verified;
- }
- }
await sleep(3000);
}
}
}
+ }
async disconnect() {
return await this.transport.disconnect();
