Skip to content

Commit 1c4dc89

Browse files
authored
chore(schema): rename ReferenceType to ReferenceableType (#22698)
1 parent 9d9c19c commit 1c4dc89

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

Diff for: schema/diff/field_diff.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package diff
33
import "cosmossdk.io/schema"
44

55
// FieldDiff represents the difference between two fields.
6-
// The KindChanged, NullableChanged, and ReferenceTypeChanged methods can be used to determine
6+
// The KindChanged, NullableChanged, and ReferenceableTypeChanged methods can be used to determine
77
// what specific changes were made to the field.
88
type FieldDiff struct {
99
// Name is the name of the field.
@@ -22,11 +22,11 @@ type FieldDiff struct {
2222
NewNullable bool
2323

2424
// OldReferencedType is the name of the old referenced type.
25-
// It will be empty if the field is not a reference type or if there was no change.
25+
// It will be empty if the field is not a referenceable type or if there was no change.
2626
OldReferencedType string
2727

2828
// NewReferencedType is the name of the new referenced type.
29-
// It will be empty if the field is not a reference type or if there was no change.
29+
// It will be empty if the field is not a referenceable type or if there was no change.
3030
NewReferencedType string
3131
}
3232

@@ -52,7 +52,7 @@ func compareField(oldField, newField schema.Field) FieldDiff {
5252

5353
// Empty returns true if the field diff has no changes.
5454
func (d FieldDiff) Empty() bool {
55-
return !d.KindChanged() && !d.NullableChanged() && !d.ReferenceTypeChanged()
55+
return !d.KindChanged() && !d.NullableChanged() && !d.ReferenceableTypeChanged()
5656
}
5757

5858
// KindChanged returns true if the field kind changed.
@@ -65,7 +65,7 @@ func (d FieldDiff) NullableChanged() bool {
6565
return d.OldNullable != d.NewNullable
6666
}
6767

68-
// ReferenceTypeChanged returns true if the referenced type changed.
69-
func (d FieldDiff) ReferenceTypeChanged() bool {
68+
// ReferenceableTypeChanged returns true if the referenced type changed.
69+
func (d FieldDiff) ReferenceableTypeChanged() bool {
7070
return d.OldReferencedType != d.NewReferencedType
7171
}

Diff for: schema/diff/field_diff_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func Test_compareField(t *testing.T) {
4545
OldReferencedType: "old",
4646
NewReferencedType: "new",
4747
},
48-
trueF: FieldDiff.ReferenceTypeChanged,
48+
trueF: FieldDiff.ReferenceableTypeChanged,
4949
},
5050
}
5151

Diff for: schema/enum.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ func (e EnumType) TypeName() string {
4141
return e.Name
4242
}
4343

44-
func (EnumType) isType() {}
45-
func (EnumType) isReferenceType() {}
44+
func (EnumType) isType() {}
45+
func (EnumType) isReferenceableType() {}
4646

4747
// Validate validates the enum definition.
4848
func (e EnumType) Validate(TypeSet) error {

Diff for: schema/type.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ type Type interface {
1313
isType()
1414
}
1515

16-
// ReferenceType is a marker interface that all types that can be the target of Field.ReferencedType implement.
16+
// ReferenceableType is a marker interface that all types that can be the target of Field.ReferencedType implement.
1717
// Currently, this is only EnumType.
18-
type ReferenceType interface {
18+
type ReferenceableType interface {
1919
Type
2020

2121
// isReferenceType is implemented if this is a reference type.
22-
isReferenceType()
22+
isReferenceableType()
2323
}
2424

2525
// TypeSet represents something that has types and allows them to be looked up by name.

0 commit comments

Comments
 (0)