Skip to content

Commit 1fa8c14

Browse files
committed
cleaning up possible error case
1 parent 90bc88d commit 1fa8c14

File tree

1 file changed

+7
-1
lines changed
  • target_chains/ethereum/contracts/contracts/entropy

1 file changed

+7
-1
lines changed

target_chains/ethereum/contracts/contracts/entropy/Entropy.sol

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,13 @@ abstract contract Entropy is IEntropy, EntropyState {
257257
req.callbackStatus = isRequestWithCallback
258258
? EntropyStatusConstants.CALLBACK_NOT_STARTED
259259
: EntropyStatusConstants.CALLBACK_NOT_NECESSARY;
260-
req.gasLimit10k = roundGas(callbackGasLimit);
260+
if (providerInfo.defaultGasLimit == 0) {
261+
// Provider doesn't support the new callback failure state flow (toggled by setting the gas limit field).
262+
// Set gasLimit10k to 0 to disable.
263+
req.gasLimit10k = 0;
264+
} else {
265+
req.gasLimit10k = roundGas(callbackGasLimit);
266+
}
261267
}
262268

263269
// As a user, request a random number from `provider`. Prior to calling this method, the user should

0 commit comments

Comments
 (0)