1
- import { ChainId } from '@wormhole-foundation/sdk-base' ;
1
+ import { ChainId , Network } from '@wormhole-foundation/sdk-base' ;
2
2
import {
3
- Environment ,
4
3
MISS_THRESHOLD_IN_MINS ,
5
4
explorerBlock ,
6
5
explorerTx ,
7
- getEnvironment ,
6
+ getNetwork ,
8
7
} from '@wormhole-foundation/wormhole-monitor-common' ;
9
8
import { chainIdToName } from '@wormhole-foundation/wormhole-monitor-common' ;
10
9
import { Firestore } from 'firebase-admin/firestore' ;
@@ -41,7 +40,7 @@ interface GovernedVAA {
41
40
// The key is the vaaKey
42
41
type GovernedVAAMap = Map < string , GovernedVAA > ;
43
42
44
- const network : Environment = getEnvironment ( ) ;
43
+ const network : Network = getNetwork ( ) ;
45
44
46
45
export async function alarmMissingVaas ( req : any , res : any ) {
47
46
res . set ( 'Access-Control-Allow-Origin' , '*' ) ;
@@ -119,7 +118,7 @@ export async function alarmMissingVaas(req: any, res: any) {
119
118
console . log ( `skipping over ${ vaaKey } because it is governed` ) ;
120
119
continue ;
121
120
}
122
- if ( await isVAASigned ( getEnvironment ( ) , vaaKey ) ) {
121
+ if ( await isVAASigned ( getNetwork ( ) , vaaKey ) ) {
123
122
console . log ( `skipping over ${ vaaKey } because it is signed` ) ;
124
123
continue ;
125
124
}
@@ -131,7 +130,7 @@ export async function alarmMissingVaas(req: any, res: any) {
131
130
txhash : msg . txHash ,
132
131
vaaKey : vaaKey ,
133
132
} ) ;
134
- if ( network === 'mainnet ' ) {
133
+ if ( network === 'Mainnet ' ) {
135
134
alarmSlackInfo . msg = formatMessage ( msg ) ;
136
135
await formatAndSendToSlack ( alarmSlackInfo ) ;
137
136
}
@@ -251,7 +250,7 @@ async function getAndProcessReobsVAAs(): Promise<Map<string, ReobserveInfo>> {
251
250
if ( data ) {
252
251
const vaas : ReobserveInfo [ ] = data . VAAs ;
253
252
vaas . forEach ( async ( vaa ) => {
254
- if ( ! ( await isVAASigned ( getEnvironment ( ) , vaa . vaaKey ) ) ) {
253
+ if ( ! ( await isVAASigned ( getNetwork ( ) , vaa . vaaKey ) ) ) {
255
254
console . log ( 'keeping reobserved VAA in firestore' , vaa . vaaKey ) ;
256
255
current . set ( vaa . txhash , vaa ) ;
257
256
} else {
0 commit comments