Skip to content

Commit

Permalink
chg: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcello33 committed Mar 11, 2024
1 parent 4ee8508 commit 79f4aa5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion consensus/bor/snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func TestRandomAddresses(t *testing.T) {
t.Parallel()

rapid.Check(t, func(t *rapid.T) {
length := rapid.IntMax(300).Draw(t, "length").(int)
length := rapid.IntMax(300).AsAny().Draw(t, "length").(int)

addrs := randomAddresses(length)
addressSet := unique.New(addrs)
Expand Down
20 changes: 10 additions & 10 deletions eth/downloader/whitelist/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,9 @@ func TestPropertyBasedTestingMilestone(t *testing.T) {
}

var (
milestoneEndNum = rapid.Uint64().Draw(t, "endBlock")
milestoneID = rapid.String().Draw(t, "MilestoneID")
doLock = rapid.Bool().Draw(t, "Voted")
milestoneEndNum = rapid.Uint64().AsAny().Draw(t, "endBlock")
milestoneID = rapid.String().AsAny().Draw(t, "MilestoneID")
doLock = rapid.Bool().AsAny().Draw(t, "Voted")
)

val := milestone.LockMutex(milestoneEndNum.(uint64))
Expand Down Expand Up @@ -760,8 +760,8 @@ func TestPropertyBasedTestingMilestone(t *testing.T) {
}

var (
start = rapid.Uint64Max(milestoneEndNum.(uint64)).Draw(t, "start for mock chain")
end = rapid.Uint64Min(start.(uint64)).Filter(fitlerFn).Draw(t, "end for mock chain")
start = rapid.Uint64Max(milestoneEndNum.(uint64)).AsAny().Draw(t, "start for mock chain")
end = rapid.Uint64Min(start.(uint64)).Filter(fitlerFn).AsAny().Draw(t, "end for mock chain")
)

chainTemp := createMockChain(start.(uint64), end.(uint64))
Expand All @@ -780,9 +780,9 @@ func TestPropertyBasedTestingMilestone(t *testing.T) {
}

var (
milestoneEndNum2 = rapid.Uint64().Draw(t, "endBlockNum 2")
milestoneID2 = rapid.String().Draw(t, "MilestoneID 2")
doLock2 = rapid.Bool().Draw(t, "Voted 2")
milestoneEndNum2 = rapid.Uint64().AsAny().Draw(t, "endBlockNum 2")
milestoneID2 = rapid.String().AsAny().Draw(t, "MilestoneID 2")
doLock2 = rapid.Bool().AsAny().Draw(t, "Voted 2")
)

val = milestone.LockMutex(milestoneEndNum2.(uint64))
Expand Down Expand Up @@ -862,7 +862,7 @@ func TestPropertyBasedTestingMilestone(t *testing.T) {
}

var (
milestoneNum = rapid.Uint64().Draw(t, "milestone Number")
milestoneNum = rapid.Uint64().AsAny().Draw(t, "milestone Number")
)

lockedValue := milestone.LockedMilestoneNumber
Expand Down Expand Up @@ -892,7 +892,7 @@ func TestPropertyBasedTestingMilestone(t *testing.T) {
}

var (
futureMilestoneNum = rapid.Uint64Min(milestoneNum.(uint64)).Draw(t, "future milestone Number")
futureMilestoneNum = rapid.Uint64Min(milestoneNum.(uint64)).AsAny().Draw(t, "future milestone Number")
)

isChainLocked = milestone.Locked
Expand Down

0 comments on commit 79f4aa5

Please sign in to comment.