-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rename EPOCH_DEFAULT to EPOCH_NOT_INITIALIZED #118
Conversation
@@ -159,7 +159,7 @@ contract LimitOrder is BaseHook { | |||
|
|||
function _fillEpoch(PoolKey calldata key, int24 lower, bool zeroForOne) internal { | |||
Epoch epoch = getEpoch(key, lower, zeroForOne); | |||
if (!epoch.equals(EPOCH_DEFAULT)) { | |||
if (!epoch.equals(EPOCH_NOT_INITIALIZED)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm i actually find this harder to read..
if epoch does not equal epoch not initialized ? its like double negative
maybe could you provide some more context/motivation for this name change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i feel like it makes the logic easier to follow. it emphasizes that there is nothing in that specific epoch. "default" feels confusing. maybe change the constant to EPOCH_EMPTY?
@@ -57,7 +57,7 @@ contract LimitOrder is BaseHook { | |||
|
|||
bytes internal constant ZERO_BYTES = bytes(""); | |||
|
|||
Epoch private constant EPOCH_DEFAULT = Epoch.wrap(0); | |||
Epoch private constant EPOCH_EMPTY = Epoch.wrap(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i dont mind this - but i'd maybe go for ZERO_EPOCH
? to match when we use things like ZERO_ADDRESS
?
we arent featuring example hooks in this repo at this time, so closing for now |
Related Issue
improves code clarity
Description of changes
rename EPOCH_DEFAULT to EPOCH_NOT_INITIALIZED in LimitOrder.sol