Skip to content

Commit 263e588

Browse files
committed
Fix Adjudicator test parameter generation.
The adjudicator test has a funding timeout of one challenge duration (measured in blocks), but the challenge duration was [0, 3600). Now, it is generated in [200, 3600). Signed-off-by: Steffen Rattay <steffen@perun.network>
1 parent df07c9c commit 263e588

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

backend/ethereum/channel/conclude_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,12 @@ func TestAdjudicator_ConcludeWithSubChannels(t *testing.T) {
102102
// 0. setup
103103

104104
const (
105-
numParts = 2
106-
maxCountSubChannels = 3
107-
maxCountSubSubChannels = 3
108-
maxChallengeDuration = 3600
105+
numParts = 2
106+
maxCountSubChannels = 3
107+
maxCountSubSubChannels = 3
108+
minFundingTXBlocksTimeout = 200
109+
minChallengeDuration = minFundingTXBlocksTimeout
110+
challengeDurationSpread = 3600 - minChallengeDuration
109111
)
110112
ctx, cancel := newDefaultTestContext()
111113
defer cancel()
@@ -121,7 +123,7 @@ func TestAdjudicator_ConcludeWithSubChannels(t *testing.T) {
121123
accounts = s.Accs
122124
participants = s.Parts
123125
asset = s.Asset
124-
challengeDuration = uint64(rng.Intn(maxChallengeDuration))
126+
challengeDuration = uint64(rng.Intn(challengeDurationSpread) + minChallengeDuration)
125127
makeRandomChannel = func(rng *rand.Rand, ledger bool) paramsAndState {
126128
return makeRandomChannel(rng, participants, asset, challengeDuration, ledger)
127129
}

0 commit comments

Comments
 (0)