@@ -1778,7 +1778,6 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
17781778 // can never cause a callback to fail because it runs out of gas.
17791779 vm.prank (provider1);
17801780 random.setDefaultGasLimit (0 );
1781-
17821781 assertCallbackResult (0 , 190000 , true );
17831782 assertCallbackResult (0 , 210000 , true );
17841783 assertCallbackResult (300000 , 290000 , true );
@@ -1864,12 +1863,13 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
18641863 assertEq (callbackFailed, true );
18651864 assertEq (callbackErrorCode, bytes ("" ));
18661865
1867- // callback gas usage is approximate and only triggered when the provider has set a gas limit.
1868- // Note: this condition is somewhat janky, but we hit the stack limit so can't put in any more local variables : (
1869- assertTrue (
1866+ // callback gas usage is approximate
1867+ assertTrue (
1868+ random. getProviderInfoV2 (provider1).defaultGasLimit == 0 ||
18701869 ((callbackGasUsage * 90 ) / 100 < callbackGasUsed)
18711870 );
1872- assertTrue (
1871+ assertTrue (
1872+ random.getProviderInfoV2 (provider1).defaultGasLimit == 0 ||
18731873 (callbackGasUsed < (callbackGasUsage * 110 ) / 100 )
18741874 );
18751875 assertEq (extraArgs, bytes ("" ));
@@ -1939,16 +1939,9 @@ contract EntropyTest is Test, EntropyTestUtils, EntropyEvents, EntropyEventsV2 {
19391939 );
19401940 assertEq (callbackFailed, false );
19411941 assertEq (callbackErrorCode, bytes ("" ));
1942- // callback gas usage is approximate and only triggered when the provider has set a gas limit
1943- // Note: this condition is somewhat janky, but we hit the stack limit so can't put in any more local variables :(
1944- assertTrue (
1945- random.getProviderInfoV2 (provider1).defaultGasLimit == 0 ||
1946- ((callbackGasUsage * 90 ) / 100 < callbackGasUsed)
1947- );
1948- assertTrue (
1949- random.getProviderInfoV2 (provider1).defaultGasLimit == 0 ||
1950- (callbackGasUsed < (callbackGasUsage * 110 ) / 100 )
1951- );
1942+ // callback gas usage is approximate
1943+ assertTrue ((callbackGasUsage * 90 ) / 100 < callbackGasUsed);
1944+ assertTrue (callbackGasUsed < (callbackGasUsage * 110 ) / 100 );
19521945 assertEq (extraArgs, bytes ("" ));
19531946
19541947 // Verify request is cleared after successful callback
0 commit comments