Skip to content

Commit

Permalink
Eth Adjudicator: Fix test's parameter generation
Browse files Browse the repository at this point in the history
The adjudicator test has a funding timeout of one challenge duration
(measured in blocks), but the challenge duration was in the range
[0, 3600). Now, it is generated in the range[200, 3600).

Issue #239 (adding a designated funding timeout parameter) would solve
this problem in a cleaner way, however, the implementation concept is
still unclear.

Signed-off-by: Steffen Rattay <[email protected]>
  • Loading branch information
RmbRT committed Feb 9, 2022
1 parent 5e5210b commit c840d9a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions backend/ethereum/channel/conclude_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@ func TestAdjudicator_ConcludeWithSubChannels(t *testing.T) {
// 0. setup

const (
numParts = 2
maxCountSubChannels = 3
maxCountSubSubChannels = 3
maxChallengeDuration = 3600
numParts = 2
maxCountSubChannels = 3
maxCountSubSubChannels = 3
minFundingTXBlocksTimeout = 200
minChallengeDuration = minFundingTXBlocksTimeout
maxChallengeDuration = 3600
challengeDurationSpread = maxChallengeDuration - minChallengeDuration
)
ctx, cancel := newDefaultTestContext()
defer cancel()
Expand All @@ -121,7 +124,7 @@ func TestAdjudicator_ConcludeWithSubChannels(t *testing.T) {
accounts = s.Accs
participants = s.Parts
asset = s.Asset
challengeDuration = uint64(rng.Intn(maxChallengeDuration))
challengeDuration = uint64(rng.Intn(challengeDurationSpread) + minChallengeDuration)
makeRandomChannel = func(rng *rand.Rand, ledger bool) paramsAndState {
return makeRandomChannel(rng, participants, asset, challengeDuration, ledger)
}
Expand Down

0 comments on commit c840d9a

Please sign in to comment.