Skip to content

Commit 8c04c41

Browse files
committed
watcher: de-dup sui digest results
1 parent 3325a33 commit 8c04c41

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

watcher/src/watchers/SuiWatcher.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ export class SuiWatcher extends Watcher {
8989
: null;
9090
cursor = response.nextCursor;
9191
hasNextPage = response.hasNextPage;
92+
const digestArrayWithDups = response.data.map((e) => e.id.txDigest);
93+
const digestArray = Array.from(new Set(digestArrayWithDups));
9294
const txBlocks = await this.client.requestWithType(
9395
'sui_multiGetTransactionBlocks',
94-
{ digests: response.data.map((e) => e.id.txDigest) },
96+
{ digests: digestArray },
9597
array(SuiTransactionBlockResponse)
9698
);
9799
const checkpointByTxDigest = txBlocks.reduce<Record<string, string | undefined>>(

0 commit comments

Comments
 (0)