From 79f4aa5edbc5928fe85b684af720ee4642f25408 Mon Sep 17 00:00:00 2001 From: marcello33 Date: Mon, 11 Mar 2024 14:28:17 +0100 Subject: [PATCH] chg: fix tests --- consensus/bor/snapshot_test.go | 2 +- eth/downloader/whitelist/service_test.go | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/consensus/bor/snapshot_test.go b/consensus/bor/snapshot_test.go index d7c1a7f498..4ac9c2cfe3 100644 --- a/consensus/bor/snapshot_test.go +++ b/consensus/bor/snapshot_test.go @@ -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) diff --git a/eth/downloader/whitelist/service_test.go b/eth/downloader/whitelist/service_test.go index aace6ff0e0..169996bf6a 100644 --- a/eth/downloader/whitelist/service_test.go +++ b/eth/downloader/whitelist/service_test.go @@ -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)) @@ -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)) @@ -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)) @@ -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 @@ -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