Skip to content
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

Merged
merged 2 commits into from
Aug 27, 2020

Conversation

nicholaspai
Copy link
Member

Signed-off-by: Nick Pai npai.nyc@gmail.com

Motivation

#1911

Summary

Store settlementPrice in intermediate var.

Issue(s)

Fixes #1911

Signed-off-by: Nick Pai <npai.nyc@gmail.com>
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"
Copy link
Contributor

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

Copy link
Member Author

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

Copy link
Contributor

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

Copy link
Member Author

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

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 92.71% when pulling 283591b on npai/fix-liq-withdrawn-event into 5d59ead on master.

@mrice32
Copy link
Member

mrice32 commented Aug 26, 2020

@nicholaspai don't forget to request reviewers!

@nicholaspai nicholaspai requested review from a team, kendricktan and mrice32 and removed request for a team August 26, 2020 21:44
Copy link
Member

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nicholaspai nicholaspai merged commit c210f03 into master Aug 27, 2020
@nicholaspai nicholaspai deleted the npai/fix-liq-withdrawn-event branch August 27, 2020 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LiquidationWithdrawn event's settlementPrice sometimes unexpected
5 participants