Send a declaration's large files by reference through a bucket per node, and hold no check twice on the build seat #425

Merged
mesh-tools merged 14 commits from feat/1696-declaration-files into main 2026-10-21 16:51:05 +00:00
Showing only changes of commit 8fc0d135bb - Show all commits
+24
View File
@@ -93,3 +93,27 @@ func TestTheSeatsListingShowsEachSeatsPaths(t *testing.T) {
}
}
}
// 1718/AC2: a manifest claiming node-files that serves upload and download passes the controller's module
// check, judged by the mesh-sdk it vendors; a verb outside the contract is still refused.
func TestAFilesHolderServingUploadAndDownloadCanHoldTheSeat(t *testing.T) {
seat, ok := catalogue.SeatNamed(catalogue.FilesSeat)
if !ok {
t.Fatal("node-files is not a seat")
}
serves := []string{"upload", "download"}
for _, v := range seat.Serves {
if v.Name != "upload" && v.Name != "download" {
serves = append(serves, v.Name)
}
}
holder := catalogue.Manifest{Module: "mesh-files", Version: "1", Claims: []catalogue.Claim{{
Name: catalogue.FilesSeat, Scope: catalogue.ScopeNode, Serves: serves}}}
if err := catalogue.CanHold(holder, seat); err != nil { // 1718/AC2
t.Fatalf("a holder serving upload and download is refused: %v", err)
}
holder.Claims[0].Serves = append(append([]string{}, serves...), "teleport")
if err := catalogue.CanHold(holder, seat); err == nil || !strings.Contains(err.Error(), "does not promise") {
t.Fatalf("a verb outside the contract must be refused with 'does not promise': %v", err)
}
}