@@ -563,7 +563,6 @@ contract PythGovernanceTest is
563
563
assertEq (address (pyth).balance, 1 ether);
564
564
565
565
address recipient = makeAddr ("recipient " );
566
- uint256 withdrawAmount = 0.5 ether ;
567
566
568
567
// Create governance VAA to withdraw fee
569
568
bytes memory withdrawMessage = abi.encodePacked (
@@ -572,7 +571,8 @@ contract PythGovernanceTest is
572
571
uint8 (GovernanceAction.WithdrawFee),
573
572
TARGET_CHAIN_ID,
574
573
recipient,
575
- withdrawAmount
574
+ uint64 (5 ), // value = 5
575
+ uint64 (17 ) // exponent = 17 (5 * 10^17 = 0.5 ether)
576
576
);
577
577
578
578
bytes memory vaa = encodeAndSignMessage (
@@ -583,7 +583,7 @@ contract PythGovernanceTest is
583
583
);
584
584
585
585
vm.expectEmit (true , true , true , true );
586
- emit FeeWithdrawn (recipient, withdrawAmount );
586
+ emit FeeWithdrawn (recipient, 0.5 ether );
587
587
588
588
PythGovernance (address (pyth)).executeGovernanceInstruction (vaa);
589
589
@@ -598,7 +598,6 @@ contract PythGovernanceTest is
598
598
assertEq (address (pyth).balance, 1 ether);
599
599
600
600
address recipient = makeAddr ("recipient " );
601
- uint256 withdrawAmount = 2 ether ; // More than contract balance
602
601
603
602
// Create governance VAA to withdraw fee
604
603
bytes memory withdrawMessage = abi.encodePacked (
@@ -607,7 +606,8 @@ contract PythGovernanceTest is
607
606
uint8 (GovernanceAction.WithdrawFee),
608
607
TARGET_CHAIN_ID,
609
608
recipient,
610
- withdrawAmount
609
+ uint64 (2 ), // value = 2
610
+ uint64 (18 ) // exponent = 18 (2 * 10^18 = 2 ether, more than balance)
611
611
);
612
612
613
613
bytes memory vaa = encodeAndSignMessage (
@@ -627,7 +627,6 @@ contract PythGovernanceTest is
627
627
628
628
function testWithdrawFeeInvalidGovernance () public {
629
629
address recipient = makeAddr ("recipient " );
630
- uint256 withdrawAmount = 0.5 ether ;
631
630
632
631
// Create governance VAA with wrong emitter
633
632
bytes memory withdrawMessage = abi.encodePacked (
@@ -636,7 +635,8 @@ contract PythGovernanceTest is
636
635
uint8 (GovernanceAction.WithdrawFee),
637
636
TARGET_CHAIN_ID,
638
637
recipient,
639
- withdrawAmount
638
+ uint64 (5 ), // value = 5
639
+ uint64 (17 ) // exponent = 17 (5 * 10^17 = 0.5 ether)
640
640
);
641
641
642
642
bytes memory vaa = encodeAndSignMessage (
0 commit comments