@@ -563,7 +563,6 @@ contract PythGovernanceTest is
563563 assertEq (address (pyth).balance, 1 ether);
564564
565565 address recipient = makeAddr ("recipient " );
566- uint256 withdrawAmount = 0.5 ether ;
567566
568567 // Create governance VAA to withdraw fee
569568 bytes memory withdrawMessage = abi.encodePacked (
@@ -572,7 +571,8 @@ contract PythGovernanceTest is
572571 uint8 (GovernanceAction.WithdrawFee),
573572 TARGET_CHAIN_ID,
574573 recipient,
575- withdrawAmount
574+ uint64 (5 ), // value = 5
575+ uint64 (17 ) // exponent = 17 (5 * 10^17 = 0.5 ether)
576576 );
577577
578578 bytes memory vaa = encodeAndSignMessage (
@@ -583,7 +583,7 @@ contract PythGovernanceTest is
583583 );
584584
585585 vm.expectEmit (true , true , true , true );
586- emit FeeWithdrawn (recipient, withdrawAmount );
586+ emit FeeWithdrawn (recipient, 0.5 ether );
587587
588588 PythGovernance (address (pyth)).executeGovernanceInstruction (vaa);
589589
@@ -598,7 +598,6 @@ contract PythGovernanceTest is
598598 assertEq (address (pyth).balance, 1 ether);
599599
600600 address recipient = makeAddr ("recipient " );
601- uint256 withdrawAmount = 2 ether ; // More than contract balance
602601
603602 // Create governance VAA to withdraw fee
604603 bytes memory withdrawMessage = abi.encodePacked (
@@ -607,7 +606,8 @@ contract PythGovernanceTest is
607606 uint8 (GovernanceAction.WithdrawFee),
608607 TARGET_CHAIN_ID,
609608 recipient,
610- withdrawAmount
609+ uint64 (2 ), // value = 2
610+ uint64 (18 ) // exponent = 18 (2 * 10^18 = 2 ether, more than balance)
611611 );
612612
613613 bytes memory vaa = encodeAndSignMessage (
@@ -627,7 +627,6 @@ contract PythGovernanceTest is
627627
628628 function testWithdrawFeeInvalidGovernance () public {
629629 address recipient = makeAddr ("recipient " );
630- uint256 withdrawAmount = 0.5 ether ;
631630
632631 // Create governance VAA with wrong emitter
633632 bytes memory withdrawMessage = abi.encodePacked (
@@ -636,7 +635,8 @@ contract PythGovernanceTest is
636635 uint8 (GovernanceAction.WithdrawFee),
637636 TARGET_CHAIN_ID,
638637 recipient,
639- withdrawAmount
638+ uint64 (5 ), // value = 5
639+ uint64 (17 ) // exponent = 17 (5 * 10^17 = 0.5 ether)
640640 );
641641
642642 bytes memory vaa = encodeAndSignMessage (
0 commit comments