Skip to content

Commit

Permalink
PLT-3382 Added comment on When equality test.
Browse files Browse the repository at this point in the history
This addresses the following audit-report comment:

> The equality of cases for the `When` constructor would be
> simplified by using `cases1 == cases2`. If there is a reason
> for the more verbose equality condition, it should be outlined
> in a comment.
  • Loading branch information
bwbush committed Mar 29, 2023
1 parent 139d592 commit faaae17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion marlowe/src/Language/Marlowe/Core/V1/Semantics/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ instance Eq Contract where
If obs1 cont1 cont2 == If obs2 cont3 cont4 =
obs1 == obs2 && cont1 == cont3 && cont2 == cont4
If{} == _ = False
When cases1 timeout1 cont1 == When cases2 timeout2 cont2 =
When cases1 timeout1 cont1 == When cases2 timeout2 cont2 = -- The sequences of tests are ordered for efficiency.
timeout1 == timeout2 && cont1 == cont2
&& length cases1 == length cases2
&& and (zipWith (==) cases1 cases2)
Expand Down

0 comments on commit faaae17

Please sign in to comment.