Migrate NPC registry durable contract

This commit is contained in:
2026-08-05 18:25:04 +00:00
parent 916a32195b
commit 9653e06297
56 changed files with 256 additions and 237 deletions

View File

@@ -181,7 +181,7 @@ func TestExtractResolvesGeneratedRegistryAtOperationTime(t *testing.T) {
}
func TestExtractAcceptsEmptyBoundRegistryAndEmptyResponse(t *testing.T) {
content, err := npccodec.New().Encode(dnd.NPCList{NPCs: []dnd.NPC{}})
content, err := npccodec.New().Encode(dnd.NPCRegistry{NPCs: []dnd.NPC{}})
if err != nil {
t.Fatal(err)
}
@@ -239,7 +239,7 @@ func TestModuleSpecRegistrationMetadataAndFingerprints(t *testing.T) {
registrySlot = slot
}
}
if !registrySlot.Required || !reflect.DeepEqual(registrySlot.AcceptedArtifactKinds, []contracts.ArtifactKind{dnd.NPCListKind}) || registrySlot.MaxBytes != NPCRegistryMaxBytes {
if !registrySlot.Required || !reflect.DeepEqual(registrySlot.AcceptedArtifactKinds, []contracts.ArtifactKind{dnd.NPCRegistryKind}) || registrySlot.MaxBytes != NPCRegistryMaxBytes {
t.Fatalf("NPC registry slot = %#v", registrySlot)
}
got.ReferenceSlots[0].AcceptedMediaTypes[0] = "changed"
@@ -326,7 +326,7 @@ func requiredRegistryReferences(t *testing.T, names ...string) contracts.Referen
SourceRefs: []source.SourceRef{{SourceID: "other-session", StartUnitID: index + 1, EndUnitID: index + 1}},
}
}
content, err := npccodec.New().Encode(dnd.NPCList{NPCs: npcs})
content, err := npccodec.New().Encode(dnd.NPCRegistry{NPCs: npcs})
if err != nil {
t.Fatal(err)
}