-
Notifications
You must be signed in to change notification settings - Fork 175
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
fix(emp-contract): LiquidationWithdrawn settlementPrice emitted correctly. #1912
Conversation
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
@@ -1542,7 +1542,7 @@ contract("Liquidatable", function(accounts) { | |||
// State should be uninitialized as the struct has been deleted as a result of the withdrawal. | |||
// Once a dispute fails and the liquidator withdraws the struct is removed from state. | |||
ev.liquidationStatus.toString() == LiquidationStatesEnum.UNINITIALIZED && | |||
ev.settlementPrice.toString() == "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.
oh were these cases where the value was empty before
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.
Not empty but 0 because the struct was deleted. These tests were therefore false positives because we fixed the the RHS of the assert.equal to match the (unexpected) 0 price
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.
These should be using JavaScript triple equals
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 they all should good catch
@nicholaspai don't forget to request reviewers! |
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.
LGTM!
Signed-off-by: Nick Pai npai.nyc@gmail.com
Motivation
#1911
Summary
Store
settlementPrice
in intermediate var.Issue(s)
Fixes #1911