@@ -39,21 +39,21 @@ contract PegInRegisterTimingFuzzTest is PegInFuzzTestBase {
3939 fuzzUser,
4040 fullLp
4141 );
42- bytes32 quoteHash = pegInContract.hashPegInQuote (quote);
42+ bytes32 eip712Hash = pegInContract.hashPegInQuoteEIP712 (quote);
4343
4444 // First do callForUser to set state to CALL_DONE
4545 vm.prank (fullLp);
4646 pegInContract.callForUser {value: callValue}(quote);
4747
4848 // Sign a different hash (wrong signature)
49- vm.assume (randomHash != quoteHash );
50- bytes memory wrongSignature = signFuzzQuote (pegInLp, randomHash);
49+ vm.assume (randomHash != eip712Hash );
50+ bytes memory wrongSignature = signMessageHash (pegInLp, randomHash);
5151
5252 vm.expectRevert (
5353 abi.encodeWithSelector (
5454 SignatureValidator.IncorrectSignature.selector ,
5555 fullLp,
56- quoteHash ,
56+ eip712Hash ,
5757 wrongSignature
5858 )
5959 );
@@ -78,20 +78,20 @@ contract PegInRegisterTimingFuzzTest is PegInFuzzTestBase {
7878 fuzzUser,
7979 fullLp
8080 );
81- bytes32 quoteHash = pegInContract.hashPegInQuote (quote);
81+ bytes32 eip712Hash = pegInContract.hashPegInQuoteEIP712 (quote);
8282
8383 // First do callForUser
8484 vm.prank (fullLp);
8585 pegInContract.callForUser {value: callValue}(quote);
8686
8787 // Sign with wrong LP (pegInLp instead of fullLp)
88- bytes memory wrongSignature = signFuzzQuote (pegInLp, quoteHash );
88+ bytes memory wrongSignature = signFuzzQuote (pegInLp, quote );
8989
9090 vm.expectRevert (
9191 abi.encodeWithSelector (
9292 SignatureValidator.IncorrectSignature.selector ,
9393 fullLp,
94- quoteHash ,
94+ eip712Hash ,
9595 wrongSignature
9696 )
9797 );
@@ -120,8 +120,7 @@ contract PegInRegisterTimingFuzzTest is PegInFuzzTestBase {
120120 fuzzUser,
121121 fullLp
122122 );
123- bytes32 quoteHash = pegInContract.hashPegInQuote (quote);
124- bytes memory signature = signFuzzQuote (fullLp, quoteHash);
123+ bytes memory signature = signFuzzQuote (fullLp, quote);
125124
126125 // First do callForUser
127126 vm.prank (fullLp);
@@ -158,7 +157,7 @@ contract PegInRegisterTimingFuzzTest is PegInFuzzTestBase {
158157 fullLp
159158 );
160159 bytes32 quoteHash = pegInContract.hashPegInQuote (quote);
161- bytes memory signature = signFuzzQuote (fullLp, quoteHash );
160+ bytes memory signature = signFuzzQuote (fullLp, quote );
162161
163162 uint256 peginAmount = getTotalQuoteValue (quote);
164163
@@ -222,8 +221,7 @@ contract PegInRegisterTimingFuzzTest is PegInFuzzTestBase {
222221 fuzzUser,
223222 fullLp
224223 );
225- bytes32 quoteHash = pegInContract.hashPegInQuote (quote);
226- bytes memory signature = signFuzzQuote (fullLp, quoteHash);
224+ bytes memory signature = signFuzzQuote (fullLp, quote);
227225
228226 // Setup bridge to return confirmations error
229227 int256 BRIDGE_UNPROCESSABLE_ERROR = - 303 ;
@@ -261,8 +259,7 @@ contract PegInRegisterTimingFuzzTest is PegInFuzzTestBase {
261259 fuzzUser,
262260 fullLp
263261 );
264- bytes32 quoteHash = pegInContract.hashPegInQuote (quote);
265- bytes memory signature = signFuzzQuote (fullLp, quoteHash);
262+ bytes memory signature = signFuzzQuote (fullLp, quote);
266263
267264 // Setup bridge to return unexpected error
268265 bridgeMock.setPeginError (errorCode);
@@ -301,7 +298,7 @@ contract PegInRegisterTimingFuzzTest is PegInFuzzTestBase {
301298 fullLp
302299 );
303300 bytes32 quoteHash = pegInContract.hashPegInQuote (quote);
304- bytes memory signature = signFuzzQuote (fullLp, quoteHash );
301+ bytes memory signature = signFuzzQuote (fullLp, quote );
305302
306303 // Setup BTC block headers
307304 bytes memory firstHeader = createBtcBlockHeader (
@@ -355,7 +352,7 @@ contract PegInRegisterTimingFuzzTest is PegInFuzzTestBase {
355352 fullLp
356353 );
357354 bytes32 quoteHash = pegInContract.hashPegInQuote (quote);
358- bytes memory signature = signFuzzQuote (fullLp, quoteHash );
355+ bytes memory signature = signFuzzQuote (fullLp, quote );
359356
360357 // Setup BTC block headers
361358 bytes memory firstHeader = createBtcBlockHeader (
@@ -411,7 +408,7 @@ contract PegInRegisterTimingFuzzTest is PegInFuzzTestBase {
411408 fullLp
412409 );
413410 bytes32 quoteHash = pegInContract.hashPegInQuote (quote);
414- bytes memory signature = signFuzzQuote (fullLp, quoteHash );
411+ bytes memory signature = signFuzzQuote (fullLp, quote );
415412
416413 uint256 peginAmount = getTotalQuoteValue (quote);
417414
@@ -467,7 +464,7 @@ contract PegInRegisterTimingFuzzTest is PegInFuzzTestBase {
467464 fullLp
468465 );
469466 bytes32 quoteHash = pegInContract.hashPegInQuote (quote);
470- bytes memory signature = signFuzzQuote (fullLp, quoteHash );
467+ bytes memory signature = signFuzzQuote (fullLp, quote );
471468
472469 uint256 peginAmount = getTotalQuoteValue (quote);
473470
@@ -530,7 +527,7 @@ contract PegInRegisterTimingFuzzTest is PegInFuzzTestBase {
530527 fullLp
531528 );
532529 bytes32 quoteHash = pegInContract.hashPegInQuote (quote);
533- bytes memory signature = signFuzzQuote (fullLp, quoteHash );
530+ bytes memory signature = signFuzzQuote (fullLp, quote );
534531
535532 uint256 peginAmount = getTotalQuoteValue (quote);
536533 uint256 totalPaid = peginAmount + extraPaid;
@@ -595,7 +592,7 @@ contract PegInRegisterTimingFuzzTest is PegInFuzzTestBase {
595592 fullLp
596593 );
597594 bytes32 quoteHash = pegInContract.hashPegInQuote (quote);
598- bytes memory signature = signFuzzQuote (fullLp, quoteHash );
595+ bytes memory signature = signFuzzQuote (fullLp, quote );
599596
600597 uint256 peginAmount = getTotalQuoteValue (quote);
601598 vm.assume (underpayment < peginAmount);
0 commit comments