@@ -71,7 +71,7 @@ export type ChainConfig = {
71
71
token : string ,
72
72
transceivers : {
73
73
threshold : number ,
74
- wormhole : string ,
74
+ wormhole : { address : string , pauser ?: string } ,
75
75
} ,
76
76
limits : {
77
77
outbound : string ,
@@ -1312,6 +1312,29 @@ async function pushDeployment<C extends Chain>(deployment: Deployment<C>, signer
1312
1312
}
1313
1313
}
1314
1314
}
1315
+ } else if ( k === "transceivers" ) {
1316
+ // TODO: refactor this nested loop stuff into separate functions at least
1317
+ // alternatively we could first recursively collect all the things
1318
+ // to do into a flattened list (with entries like
1319
+ // transceivers.wormhole.pauser), and have a top-level mapping of
1320
+ // these entries to how they should be handled
1321
+ for ( const j of Object . keys ( diff [ k ] as object ) ) {
1322
+ if ( j === "wormhole" ) {
1323
+ for ( const l of Object . keys ( diff [ k ] ! [ j ] as object ) ) {
1324
+ if ( l === "pauser" ) {
1325
+ const newTransceiverPauser = toUniversal ( deployment . manager . chain , diff [ k ] ! [ j ] ! [ l ] ! . push ! ) ;
1326
+ txs . push ( deployment . whTransceiver . setPauser ( newTransceiverPauser , signer . address . address ) ) ;
1327
+ } else {
1328
+ console . error ( `Unsupported field: ${ k } .${ j } .${ l } ` ) ;
1329
+ process . exit ( 1 ) ;
1330
+ }
1331
+ }
1332
+ } else {
1333
+ console . error ( `Unsupported field: ${ k } .${ j } ` ) ;
1334
+ process . exit ( 1 ) ;
1335
+
1336
+ }
1337
+ }
1315
1338
} else {
1316
1339
console . error ( `Unsupported field: ${ k } ` ) ;
1317
1340
process . exit ( 1 ) ;
@@ -1404,6 +1427,8 @@ async function pullChainConfig<N extends Network, C extends Chain>(
1404
1427
1405
1428
const version = getVersion ( manager . chain , ntt ) ;
1406
1429
1430
+ const transceiverPauser = await ntt . getTransceiver ( 0 ) . then ( ( t ) => t ?. getPauser ( ) ?? null ) ;
1431
+
1407
1432
const config : ChainConfig = {
1408
1433
version,
1409
1434
mode,
@@ -1413,13 +1438,16 @@ async function pullChainConfig<N extends Network, C extends Chain>(
1413
1438
token : addresses . token ! ,
1414
1439
transceivers : {
1415
1440
threshold,
1416
- wormhole : addresses . transceiver ! . wormhole ! ,
1441
+ wormhole : { address : addresses . transceiver ! . wormhole ! } ,
1417
1442
} ,
1418
1443
limits : {
1419
1444
outbound : outboundLimitDecimals ,
1420
1445
inbound : { } ,
1421
1446
} ,
1422
1447
} ;
1448
+ if ( transceiverPauser ) {
1449
+ config . transceivers . wormhole . pauser = transceiverPauser . toString ( ) ;
1450
+ }
1423
1451
if ( pauser ) {
1424
1452
config . pauser = pauser . toString ( ) ;
1425
1453
}
0 commit comments