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

Bugfixes related to switch statements #4250

Merged

Conversation

dmos62
Copy link
Contributor

@dmos62 dmos62 commented May 10, 2020

This is a second go at #4212, which was reverted. The previous PR was fixing some problems with switch statements and a typo where a short-circuit boolean operator was used without need. This PR is the same as the last one, but the semantic/cosmetic changes (why the original PR was reverted) are removed and it also implements a suggestion by @ManfredKarrer to add a (forgotten) check.

dmos62 and others added 4 commits May 10, 2020 14:51
Non-bug; only effect that the other instanceof is always evaluated.
This omission is currently not disruptive, since the next case clause only contains a break.
Without the break statement, the execution would continue through the subsequent case clauses until it encountered a break, executing `checkArgument` calls meant for `REIMBURSEMENT_MAX_AMOUNT`. More specifically, the bug would cause a failed check in the case where `inputValueAsCoin.value <= 200000000` is false.
Manfred [0] pointed out that COMPENSATION_REQUEST_MIN_AMOUNT and
REIMBURSEMENT_MIN_AMOUNT should be checked for not exceeding 200k BSQ
too.

[0] https://github.com/bisq-network/bisq/pull/4212/files/4ec6bac658ca5c8e3cd4d4a9e0ac7207bac8799b..fb76fd65481e882ae0e232c3d8c1814e29a9e878#r420249962
@ghost
Copy link

ghost commented May 16, 2020

For the ChangeParamValidator file, there is ChangeParamValidatorTest already created. I believe it is very useful to add tests for bugs to prevent re-occurrence.

Also adding a test for validator is (I believe) technically easy (in contrast to some UI changes).

Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

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

utACK

@ManfredKarrer I still need your review on this to be able to merge, but I think this is a reasonable and safe change.

Copy link
Contributor

@ManfredKarrer ManfredKarrer left a comment

Choose a reason for hiding this comment

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

utACK

@sqrrm sqrrm merged commit bc3e122 into bisq-network:master May 26, 2020
@ripcurlx ripcurlx added this to the v1.3.5 milestone Jun 4, 2020
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.

4 participants