7
7
import { z } from 'zod' ;
8
8
import { TIMEOUT } from '../consts' ;
9
9
import { VaasByBlock } from '../databases/types' ;
10
- import { getResumeBlockByChain , storeVaasByBlock } from '../databases/utils' ;
10
+ import { getResumeBlockByChain , storeLatestBlock , storeVaasByBlock } from '../databases/utils' ;
11
11
import { getLogger , WormholeLogger } from '../utils/logger' ;
12
12
13
13
export class Watcher {
@@ -31,7 +31,7 @@ export class Watcher {
31
31
throw new Error ( 'Not Implemented' ) ;
32
32
}
33
33
34
- async getNttMessagesForBlocks ( fromBlock : number , toBlock : number ) {
34
+ async getNttMessagesForBlocks ( fromBlock : number , toBlock : number ) : Promise < string > {
35
35
throw new Error ( 'Not Implemented' ) ;
36
36
}
37
37
@@ -71,7 +71,8 @@ export class Watcher {
71
71
toBlock = Math . min ( fromBlock + this . maximumBatchSize - 1 , toBlock ) ;
72
72
this . logger . info ( `fetching messages from ${ fromBlock } to ${ toBlock } ` ) ;
73
73
if ( this . isNTT ) {
74
- await this . getNttMessagesForBlocks ( fromBlock , toBlock ) ;
74
+ const blockKey = await this . getNttMessagesForBlocks ( fromBlock , toBlock ) ;
75
+ await storeLatestBlock ( this . chain , blockKey , true ) ;
75
76
} else {
76
77
const vaasByBlock = await this . getMessagesForBlocks ( fromBlock , toBlock ) ;
77
78
await storeVaasByBlock ( this . chain , vaasByBlock ) ;
0 commit comments