feat(schema): testing utilities (#20705)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
coderabbitai[bot]
parent
6eea0ae6d2
commit
e7844e640c
@@ -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
|
||||
})
|
||||
Reference in New Issue
Block a user