cosmos / b9-checkers-academy-draft

32 stars 40 forks source link

Redundant check condition #57

Closed ThanhNhann closed 1 year ago

ThanhNhann commented 1 year ago

I see that MustRefundWager function checks three conditions with MoveCount but when we use it at EndBlocker, it just checks the case MoveCount == 1 and then calls MustRefundWager here, so it will always point in one case in MustRefundWager function and will never go to another cases like MoveCount == 0

xavierlepretre commented 1 year ago

Yes. MustRefundWager exists and should cover all situations, regardless of how it is being used.

The fix I see is that EndBlocker does not need to make the extra check for == 1 because == 0 is a valid situation.

I will include that in a future revision of the code.