@hyperbridge/sdk 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +13 -12
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +13 -12
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +13 -12
- package/dist/node/index.js.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -10312,26 +10312,27 @@ var PostRequestClient = class {
|
|
|
10312
10312
|
* accompanying timeout-proof calldata.
|
|
10313
10313
|
*/
|
|
10314
10314
|
async addTimeoutFinalityEvents(request) {
|
|
10315
|
-
const destChain = this.ctx.config.dest;
|
|
10316
|
-
const hyperbridge = this.ctx.config.hyperbridge;
|
|
10317
10315
|
const events = [];
|
|
10318
|
-
const commitment = postRequestCommitment(request).commitment;
|
|
10319
|
-
const receipt = await destChain.queryRequestReceipt(commitment);
|
|
10320
|
-
const destTimestamp = await destChain.timestamp();
|
|
10321
10316
|
const commit = (req) => {
|
|
10322
10317
|
this.logger.trace(`Added ${events.length} timeout events`, events);
|
|
10323
10318
|
request.statuses = [...req.statuses, ...events];
|
|
10324
10319
|
return request;
|
|
10325
10320
|
};
|
|
10326
10321
|
if (request.timeoutTimestamp === 0n) return commit(request);
|
|
10322
|
+
if (request.statuses.some(
|
|
10323
|
+
(item) => item.status === RequestStatus.DESTINATION || item.status === TimeoutStatus.TIMED_OUT
|
|
10324
|
+
))
|
|
10325
|
+
return commit(request);
|
|
10326
|
+
const destChain = this.ctx.config.dest;
|
|
10327
|
+
const hyperbridge = this.ctx.config.hyperbridge;
|
|
10328
|
+
const commitment = postRequestCommitment(request).commitment;
|
|
10329
|
+
const receipt = await destChain.queryRequestReceipt(commitment);
|
|
10330
|
+
const destTimestamp = await destChain.timestamp();
|
|
10327
10331
|
if (receipt || request.timeoutTimestamp > destTimestamp) return commit(request);
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
metadata: { blockHash: "0x", blockNumber: 0, transactionHash: "0x" }
|
|
10333
|
-
});
|
|
10334
|
-
}
|
|
10332
|
+
events.push({
|
|
10333
|
+
status: TimeoutStatus.PENDING_TIMEOUT,
|
|
10334
|
+
metadata: { blockHash: "0x", blockNumber: 0, transactionHash: "0x" }
|
|
10335
|
+
});
|
|
10335
10336
|
const delivered = request.statuses.find((item) => item.status === RequestStatus.HYPERBRIDGE_DELIVERED);
|
|
10336
10337
|
let hyperbridgeFinalized;
|
|
10337
10338
|
if (!delivered) {
|