aboutsummaryrefslogtreecommitdiffstats
path: root/core/test/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/test/utils.go')
-rw-r--r--core/test/utils.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/test/utils.go b/core/test/utils.go
index eae12a0..35fbdd5 100644
--- a/core/test/utils.go
+++ b/core/test/utils.go
@@ -29,3 +29,12 @@ func stableRandomHash(blockConv types.BlockConverter) (common.Hash, error) {
}
return common.NewRandomHash(), nil
}
+
+// GenerateRandomValidatorIDs generates randomly a slices of types.ValidatorID.
+func GenerateRandomValidatorIDs(validatorCount int) (vIDs types.ValidatorIDs) {
+ vIDs = types.ValidatorIDs{}
+ for i := 0; i < validatorCount; i++ {
+ vIDs = append(vIDs, types.ValidatorID{Hash: common.NewRandomHash()})
+ }
+ return
+}