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.
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
[CL Message Audit]: AddToPositions #5167
[CL Message Audit]: AddToPositions #5167
Changes from 4 commits
f4541fc
34eac4a
572cac2
bc32e4d
8178d3f
0c75c15
0eb58e0
f415df7
4eacf4c
23645b2
cbeb8ab
bbda1dc
76436b0
c1705bb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What was the change that made this no longer error?
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.
So this was the test case that made me revise all the test cases actually.
My first approach was that I noticed that this case should not error, where user should be able to add to a position with underlying lock that has finished unlocking. Then I fmt.Println along the lines for this test code, and noticed that this was not erroring due to the error type we have specified, but was erroring due to the account not having enough funds.
Funding the account prior to calling add to positions fixed this
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.
Can you show the math that results in this value?
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.
Added wolfram alpha equation for this
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.
Should these min checks not be separate tests? I don't see why we would remove/replace the negative input error cases (lmk if I'm missing something here)
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.
Same as above, added in
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.
Just to be sure: which rounding error is this meant to accommodate? I noticed in the test cases you added the withdraw amounts are rounded down in the expected values, so I'm assuming this is for the added values?
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.
yes this is for the rounding errors caused in the process of withdrawing