feat(schema): testing utilities (#20705)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Aaron Craelius
2024-07-31 06:58:30 +00:00
committed by GitHub
co-authored by coderabbitai[bot]
parent 6eea0ae6d2
commit e7844e640c
40 changed files with 2147 additions and 2 deletions
+19
View File
@@ -0,0 +1,19 @@
package schematesting
import (
"pgregory.net/rapid"
"cosmossdk.io/schema"
)
var enumValuesGen = rapid.SliceOfNDistinct(NameGen, 1, 10, func(x string) string { return x })
// EnumType generates random valid EnumTypes.
var EnumType = rapid.Custom(func(t *rapid.T) schema.EnumType {
enum := schema.EnumType{
Name: NameGen.Draw(t, "name"),
Values: enumValuesGen.Draw(t, "values"),
}
return enum
})