Skip to content

Commit

Permalink
chore(schema): update go version and const name
Browse files Browse the repository at this point in the history
  • Loading branch information
hoanguyenkh committed Jul 11, 2024
1 parent ab6400f commit 34889cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions schema/go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module cosmossdk.io/schema

// NOTE: this go.mod should have zero dependencies and remain on go 1.12 to stay compatible
// NOTE: this go.mod should have zero dependencies and remain on go 1.22 to stay compatible
// with all known production releases of the Cosmos SDK. This is to ensure that all historical
// apps could be patched to support indexing if desired.

go 1.12
go 1.22.2
4 changes: 2 additions & 2 deletions schema/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ const (
JSONKind
)

// MAX_VALID_KIND is the maximum valid kind value.
const MAX_VALID_KIND = JSONKind
// MaxValidKind is the maximum valid kind value.
const MaxValidKind = JSONKind

const (
// IntegerFormat is a regex that describes the format integer number strings must match. It specifies
Expand Down
4 changes: 2 additions & 2 deletions schema/kind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func TestKind_Validate(t *testing.T) {
for kind := InvalidKind + 1; kind <= MAX_VALID_KIND; kind++ {
for kind := InvalidKind + 1; kind <= MaxValidKind; kind++ {
if err := kind.Validate(); err != nil {
t.Errorf("expected valid kind %s to pass validation, got: %v", kind, err)
}
Expand Down Expand Up @@ -92,7 +92,7 @@ func TestKind_ValidateValueType(t *testing.T) {
}

// nils get rejected
for kind := InvalidKind + 1; kind <= MAX_VALID_KIND; kind++ {
for kind := InvalidKind + 1; kind <= MaxValidKind; kind++ {
if err := kind.ValidateValueType(nil); err == nil {
t.Errorf("expected nil value to fail validation for kind %s", kind)
}
Expand Down

0 comments on commit 34889cc

Please sign in to comment.