Skip to content

Commit

Permalink
Fix docs of revert function (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
fedgiac authored Feb 16, 2024
1 parent 60d1dc5 commit 06916f0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ConstantProduct.sol
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ contract ConstantProduct is IConditionalOrderGenerator {
}

if (tradedAmountToken0 < data.minTradedToken0) {
revertPollAtNextBucket("traded amount too small");
revertPollAtNextBlock("traded amount too small");
}

order = GPv2Order.Data(
Expand Down Expand Up @@ -244,7 +244,7 @@ contract ConstantProduct is IConditionalOrderGenerator {
*/
function sub(uint256 lhs, uint256 rhs) internal view returns (uint256) {
if (lhs < rhs) {
revertPollAtNextBucket("subtraction underflow");
revertPollAtNextBlock("subtraction underflow");
}
unchecked {
return lhs - rhs;
Expand All @@ -253,10 +253,9 @@ contract ConstantProduct is IConditionalOrderGenerator {

/**
* @dev Reverts call execution with a custom error that indicates to the
* watchtower to poll for new order at the start of the next validity
* bucket.
* watchtower to poll for new order when the next block is mined.
*/
function revertPollAtNextBucket(string memory message) internal view {
function revertPollAtNextBlock(string memory message) internal view {
revert IWatchtowerCustomErrors.PollTryAtBlock(block.number + 1, message);
}
}

0 comments on commit 06916f0

Please sign in to comment.