Skip to content

Commit d71799f

Browse files
committed
✨ [channel/test] Modified states: Allow unchanged Locked or Data
This is a preparation for backends that do not support sub-channels or apps. Signed-off-by: Matthias Geihs <matthias@perun.network>
1 parent 0897b7b commit d71799f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

channel/test/channeltest.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type Setup struct {
3636

3737
// State is a random state with parameters `Params`
3838
State *channel.State
39-
// State2 is a random state with parameters `Params2` and must differ in all fields from `State`
39+
// State2 is a random state with parameters `Params2` and should differ in all fields from `State`
4040
State2 *channel.State
4141

4242
// Account is a random account
@@ -244,7 +244,7 @@ func buildModifiedStates(s1, s2 *channel.State, modifyApp bool) (ret []channel.S
244244
}
245245
}
246246
// Modify Locked
247-
{
247+
if len(s1.Locked) > 0 || len(s2.Locked) > 0 {
248248
// Modify complete Locked
249249
{
250250
modState := s1.Clone()
@@ -274,7 +274,7 @@ func buildModifiedStates(s1, s2 *channel.State, modifyApp bool) (ret []channel.S
274274
}
275275
}
276276
// Modify Data
277-
{
277+
if !channel.IsNoData(s1.Data) || !channel.IsNoData(s2.Data) {
278278
modState := s1.Clone()
279279
modState.Data = s2.Data
280280
ret = append(ret, *modState)

0 commit comments

Comments
 (0)