This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
Simplify unexpiration logic in convertValidationResultsIntoOrderEvents #856
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f7153a8
Name and use isOrderUnexpired
153461c
Use newFillableAmount
04fbfe0
Replace nil with newFillableAmount
178a798
Consolidate checks for rewatchOrder
8791f48
Remove checks that are always true
991a69d
Move database updates into unexpiration check
788e8db
Rename to timeStampIsValid and remove unneeded check
00ff1f6
typos
26d82c5
time stamp -> timestamp and correct comment
8616a0f
Clarify comment
z2trillion 4101686
fix typo
z2trillion 54a5bb3
Remove unused private function
4931b64
Remove nil check for non-nil argument
dd1dd2d
Rename function
a96329d
Re-add comments
4e17262
Rename to expirationTimeIsValid
7eeb2e2
Expand comment
z2trillion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It looks like in the new version we do not check
oldFillableAmount.Cmp(newFillableAmount) == 0
before considering the order unexpired. Is there a reason this check is not required? Or to phrase it another way, do we know why this check was here in the old version of the code?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.
Currently, in addition to checking for unexpiration, we check for the three cases (
oldFillableAmount.Cmp(newFillableAmount) == 0
,oldFillableAmount.Cmp(newFillableAmount) != 0 && oldAmountIsMoreThenNewAmount
, andoldFillableAmount.Cmp(newFillableAmount) != 0 && !oldAmountIsMoreThenNewAmount
) and do the same thing in all three cases. Since we've covered all the possibilities, this comparison check is not needed at all.