@@ -50,38 +50,35 @@ contract MessageBusSenderTest is Test {
5050 }
5151
5252 // Test fee query on an unset dstChain
53- function testFailUnsetEstimateFee () public {
53+ function testUnsetEstimateFeeRevert () public {
54+ vm.expectRevert ("Fee not set " );
5455 messageBusSender.estimateFee (1 , bytes ("" ));
5556 }
5657
57- function testFailSendMessageWrongChainID () public {
58+ function testSendMessageWrongChainIDRevert () public {
5859 bytes32 receiverAddress = addressToBytes32 (address (1337 ));
5960 // 99 is default foundry chain id
61+ vm.expectRevert ("Fee not set " );
6062 messageBusSender.sendMessage (receiverAddress, 99 , bytes ("" ), bytes ("" ));
6163 }
6264
6365 // Enforce fees above returned fee amount from fee calculator
64- function testFailSendMessageWithLowFees () public {
65- uint256 estimatedFee = messageBusSender.estimateFee (gasFeePricingTest.expectedDstChainId (), bytes ("" ));
66+ function testSendMessageWithLowFeesRevert () public {
67+ uint256 dstChainId = gasFeePricingTest.expectedDstChainId ();
68+ uint256 estimatedFee = messageBusSender.estimateFee (dstChainId, bytes ("" ));
6669 bytes32 receiverAddress = addressToBytes32 (address (1337 ));
67- messageBusSender.sendMessage {value: estimatedFee - 1 }(
68- receiverAddress,
69- gasFeePricingTest.expectedDstChainId (),
70- bytes ("" ),
71- bytes ("" )
72- );
70+ vm.expectRevert ("Insuffient gas fee " );
71+ messageBusSender.sendMessage {value: estimatedFee - 1 }(receiverAddress, dstChainId, bytes ("" ), bytes ("" ));
7372 }
7473
7574 // Fee calculator reverts upon 0 fees (Fee is unset)
76- function testFailMessageOnUnsetFees () public {
77- uint256 estimatedFee = messageBusSender.estimateFee (gasFeePricingTest.expectedDstChainId () - 1 , bytes ("" ));
75+ function testMessageOnUnsetFeesRevert () public {
76+ uint256 dstChainId = gasFeePricingTest.expectedDstChainId () - 1 ;
77+ vm.expectRevert ("Fee not set " );
78+ uint256 estimatedFee = messageBusSender.estimateFee (dstChainId, bytes ("" ));
7879 bytes32 receiverAddress = addressToBytes32 (address (1337 ));
79- messageBusSender.sendMessage {value: estimatedFee}(
80- receiverAddress,
81- gasFeePricingTest.expectedDstChainId () - 1 ,
82- bytes ("" ),
83- bytes ("" )
84- );
80+ vm.expectRevert ("Fee not set " );
81+ messageBusSender.sendMessage {value: estimatedFee}(receiverAddress, dstChainId, bytes ("" ), bytes ("" ));
8582 }
8683
8784 // Send message without reversion, pay correct amount of fees, emit correct event
0 commit comments