@@ -205,7 +205,7 @@ export async function link(chainInfos: Ctx[], accountantPrivateKey: string) {
205
205
) ;
206
206
vaas . push ( serialize ( vaa ) ) ;
207
207
}
208
-
208
+
209
209
// Submit all registrations at once
210
210
await submitAccountantVAAs ( vaas , accountantPrivateKey ) ;
211
211
}
@@ -240,6 +240,7 @@ export async function transferWithChecks(sourceCtx: Ctx, destinationCtx: Ctx) {
240
240
241
241
console . log ( "Calling transfer on: " , sourceCtx . context . chain ) ;
242
242
const srcNtt = await getNtt ( sourceCtx ) ;
243
+
243
244
const transferTxs = srcNtt . transfer ( sender . address , srcAmt , receiver , {
244
245
queue : false ,
245
246
automatic : useRelayer ,
@@ -260,6 +261,8 @@ export async function transferWithChecks(sourceCtx: Ctx, destinationCtx: Ctx) {
260
261
const [ managerBalanceAfterRecv , userBalanceAfterRecv ] =
261
262
await getManagerAndUserBalance ( destinationCtx ) ;
262
263
264
+
265
+
263
266
checkBalances (
264
267
sourceCtx . mode ,
265
268
[ managerBalanceBeforeSend , managerBalanceAfterSend ] ,
@@ -459,7 +462,10 @@ async function deployEvm(ctx: Ctx): Promise<Ctx> {
459
462
console . log ( "Initialize the manager" ) ;
460
463
await tryAndWaitThrice ( ( ) => manager . initialize ( ) ) ;
461
464
console . log ( "Initialize the transceiver" ) ;
462
- await tryAndWaitThrice ( ( ) => transceiver . initialize ( ) ) ;
465
+ const coreFee = await ( await ctx . context . getWormholeCore ( ) ) . getMessageFee ( )
466
+ await tryAndWaitThrice ( ( ) => transceiver . initialize ( {
467
+ value : coreFee
468
+ } ) ) ;
463
469
464
470
// Setup the initial calls, like transceivers for the manager
465
471
console . log ( "Set transceiver for manager" ) ;
@@ -728,6 +734,26 @@ async function tryAndWaitThrice(
728
734
return null ;
729
735
}
730
736
737
+ export async function setMessageFee ( chains : Chain [ ] , fee : bigint ) {
738
+ console . log ( `Setting message fee for ${ chains } to ${ fee } ` )
739
+ for ( const chain of chains ) {
740
+ const chainCtx = wh . getChain ( chain )
741
+ const core = await chainCtx . getWormholeCore ( )
742
+ const coreAddress = chainCtx . config . contracts . coreBridge
743
+ const existingFee = await core . getMessageFee ( )
744
+ console . log ( `Existing core bridge fee for ${ chain } : ${ existingFee } ` )
745
+ const rpc = await chainCtx . getRpc ( )
746
+ await rpc . send ( "anvil_setStorageAt" , [
747
+ coreAddress ,
748
+ 7 , // messageFee storage slot
749
+ ethers . zeroPadValue ( ethers . toBeHex ( fee ) , 32 )
750
+ ] ) ;
751
+
752
+ const newFee = await core . getMessageFee ( )
753
+ console . log ( `New core bridge fee for ${ chain } : ${ newFee } ` )
754
+ }
755
+ }
756
+
731
757
export async function testHub (
732
758
source : Chain ,
733
759
destinationA : Chain ,
0 commit comments