refactor(schema)!: rename Schema -> TypeSet and other small renamings (#21446)
This commit is contained in:
@@ -371,7 +371,7 @@ func (e exampleBankModule) subBalance(acct, denom string, amount uint64) error {
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
exampleBankSchema, err = schema.NewModuleSchema(schema.ObjectType{
|
||||
exampleBankSchema, err = schema.CompileModuleSchema(schema.ObjectType{
|
||||
Name: "balances",
|
||||
KeyFields: []schema.Field{
|
||||
{
|
||||
@@ -435,7 +435,7 @@ type oneValueModule struct {
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
oneValueModSchema, err = schema.NewModuleSchema(schema.ObjectType{
|
||||
oneValueModSchema, err = schema.CompileModuleSchema(schema.ObjectType{
|
||||
Name: "item",
|
||||
ValueFields: []schema.Field{
|
||||
{Name: "value", Kind: schema.StringKind},
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
type modA struct{}
|
||||
|
||||
func (m modA) ModuleCodec() (schema.ModuleCodec, error) {
|
||||
modSchema, err := schema.NewModuleSchema(schema.ObjectType{Name: "A", KeyFields: []schema.Field{{Name: "field1", Kind: schema.StringKind}}})
|
||||
modSchema, err := schema.CompileModuleSchema(schema.ObjectType{Name: "A", KeyFields: []schema.Field{{Name: "field1", Kind: schema.StringKind}}})
|
||||
if err != nil {
|
||||
return schema.ModuleCodec{}, err
|
||||
}
|
||||
@@ -22,7 +22,7 @@ func (m modA) ModuleCodec() (schema.ModuleCodec, error) {
|
||||
type modB struct{}
|
||||
|
||||
func (m modB) ModuleCodec() (schema.ModuleCodec, error) {
|
||||
modSchema, err := schema.NewModuleSchema(schema.ObjectType{Name: "B", KeyFields: []schema.Field{{Name: "field2", Kind: schema.StringKind}}})
|
||||
modSchema, err := schema.CompileModuleSchema(schema.ObjectType{Name: "B", KeyFields: []schema.Field{{Name: "field2", Kind: schema.StringKind}}})
|
||||
if err != nil {
|
||||
return schema.ModuleCodec{}, err
|
||||
}
|
||||
@@ -44,7 +44,7 @@ var testResolver = ModuleSetDecoderResolver(moduleSet)
|
||||
func TestModuleSetDecoderResolver_IterateAll(t *testing.T) {
|
||||
objectTypes := map[string]bool{}
|
||||
err := testResolver.IterateAll(func(moduleName string, cdc schema.ModuleCodec) error {
|
||||
cdc.Schema.Types(func(t schema.Type) bool {
|
||||
cdc.Schema.AllTypes(func(t schema.Type) bool {
|
||||
objTyp, ok := t.(schema.ObjectType)
|
||||
if ok {
|
||||
objectTypes[objTyp.Name] = true
|
||||
|
||||
Reference in New Issue
Block a user