cosmos-sdk/schema/testing/object_test.go
Aaron Craelius ae40e809b9
refactor(schema)!: rename ObjectType -> StateObjectType (#21691)
Co-authored-by: cool-developer <51834436+cool-develope@users.noreply.github.com>
2024-09-16 08:17:52 +00:00

25 lines
672 B
Go

package schematesting
import (
"testing"
"github.com/stretchr/testify/require"
"pgregory.net/rapid"
)
func TestObject(t *testing.T) {
rapid.Check(t, func(t *rapid.T) {
objectType := StateObjectTypeGen(testEnumSchema).Draw(t, "object")
require.NoError(t, objectType.Validate(testEnumSchema))
})
}
func TestObjectUpdate(t *testing.T) {
rapid.Check(t, func(t *rapid.T) {
objectType := StateObjectTypeGen(testEnumSchema).Draw(t, "object")
require.NoError(t, objectType.Validate(testEnumSchema))
update := StateObjectInsertGen(objectType, testEnumSchema).Draw(t, "update")
require.NoError(t, objectType.ValidateObjectUpdate(update, testEnumSchema))
})
}