Skip to content

Commit c68ba53

Browse files
committed
More accurate name for structure that contains easy access to prototypes.
This is technically a breaking change, as it's an exported name, but I don't think there are references to this value outside this repo to date.
1 parent 39818c1 commit c68ba53

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

node/bindnode/fuzz_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func FuzzBindnodeViaDagCBOR(f *testing.F) {
149149
if err != nil {
150150
f.Fatal(err)
151151
}
152-
schemaNode := bindnode.Wrap(schemaDMT, schemadmt.Type.Schema.Type())
152+
schemaNode := bindnode.Wrap(schemaDMT, schemadmt.Prototypes.Schema.Type())
153153
schemaDagCBOR := marshalDagCBOR(f, schemaNode.Representation())
154154

155155
nodeBuilder := basicnode.Prototype.Any.NewBuilder()
@@ -178,7 +178,7 @@ func FuzzBindnodeViaDagCBOR(f *testing.F) {
178178
}
179179
}
180180
f.Fuzz(func(t *testing.T, schemaDagCBOR, nodeDagCBOR []byte) {
181-
schemaBuilder := schemadmt.Type.Schema.Representation().NewBuilder()
181+
schemaBuilder := schemadmt.Prototypes.Schema.Representation().NewBuilder()
182182

183183
if err := dagcbor.Decode(schemaBuilder, bytes.NewReader(schemaDagCBOR)); err != nil {
184184
t.Skipf("invalid schema-schema dag-cbor: %v", err)

schema/dmt/operations.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ func ConcatenateSchemas(a, b *Schema) *Schema {
1616
// The joy of having an intermediate form that's just regular data model:
1717
// we can implement this by simply using data model "copy" operations,
1818
// and the result is correct.
19-
nb := Type.Schema.NewBuilder()
20-
if err := datamodel.Copy(bindnode.Wrap(a, Type.Schema.Type()), nb); err != nil {
19+
nb := Prototypes.Schema.NewBuilder()
20+
if err := datamodel.Copy(bindnode.Wrap(a, Prototypes.Schema.Type()), nb); err != nil {
2121
panic(err)
2222
}
23-
if err := datamodel.Copy(bindnode.Wrap(b, Type.Schema.Type()), nb); err != nil {
23+
if err := datamodel.Copy(bindnode.Wrap(b, Prototypes.Schema.Type()), nb); err != nil {
2424
panic(err)
2525
}
2626
return bindnode.Unwrap(nb.Build()).(*Schema)

schema/dmt/roundtrip_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func testRoundtrip(t *testing.T, want string, updateFn func(string)) {
3333

3434
crre := regexp.MustCompile(`\r?\n`)
3535
want = crre.ReplaceAllString(want, "\n")
36-
nb := schemadmt.Type.Schema.Representation().NewBuilder()
36+
nb := schemadmt.Prototypes.Schema.Representation().NewBuilder()
3737
err := ipldjson.Decode(nb, strings.NewReader(want))
3838
qt.Assert(t, err, qt.IsNil)
3939
node := nb.Build().(schema.TypedNode)

schema/dmt/schema.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
// This schema follows https://ipld.io/specs/schemas/schema-schema.ipldsch.
1212

13-
var Type struct {
13+
var Prototypes struct {
1414
Schema schema.TypedPrototype
1515
}
1616

@@ -435,7 +435,7 @@ func init() {
435435

436436
TypeSystem = ts
437437

438-
Type.Schema = bindnode.Prototype(
438+
Prototypes.Schema = bindnode.Prototype(
439439
(*Schema)(nil),
440440
TypeSystem.TypeByName("Schema"),
441441
)

schema/dsl/parse_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func testParse(t *testing.T, inSchema, inJSON string, updateFn func(string)) {
116116
// Ensure we can encode the schema as the json codec,
117117
// and that it results in the same bytes as the ipldsch.json file.
118118
{
119-
node := bindnode.Wrap(sch, schemadmt.Type.Schema.Type())
119+
node := bindnode.Wrap(sch, schemadmt.Prototypes.Schema.Type())
120120

121121
var buf bytes.Buffer
122122
err := ipldjson.Encode(node.Representation(), &buf)

0 commit comments

Comments
 (0)