From 83ee7769d8ee4adc2658b26447cc9d0831a136b3 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 26 Oct 2026 12:00:29 +0100 Subject: [PATCH] Make the grants part's state in the switch's test as the part makes a declared state, by its stream (issue 1945) --- go/buscompose/userlist_switch_integration_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/go/buscompose/userlist_switch_integration_test.go b/go/buscompose/userlist_switch_integration_test.go index a2ec1d8..d8eb3fd 100644 --- a/go/buscompose/userlist_switch_integration_test.go +++ b/go/buscompose/userlist_switch_integration_test.go @@ -78,10 +78,17 @@ func TestTheBusNodeFollowsTheGrantsPartsSealedListUnderTheComposedGrants(t *test if err != nil { t.Fatal(err) } - kv, err := grants.CreateKeyValue(ctx, jetstream.KeyValueConfig{Bucket: GrantsUserListBucket}) - if err != nil { + // Its state is made as the grants part makes a declared state, by its stream's name (CreateKeyValue would ask the + // account's info, which no module is granted). + if _, err := grants.CreateStream(ctx, jetstream.StreamConfig{Name: "KV_" + GrantsUserListBucket, + Subjects: []string{"$KV." + GrantsUserListBucket + ".>"}, MaxMsgsPerSubject: 1, AllowDirect: true, + AllowRollup: true, DenyDelete: true, Discard: jetstream.DiscardNew}); err != nil { t.Fatalf("the grants part's state: %v", err) } + kv, err := grants.KeyValue(ctx, GrantsUserListBucket) + if err != nil { + t.Fatalf("the grants part binds its state: %v", err) + } objects, err := grants.CreateObjectStore(ctx, jetstream.ObjectStoreConfig{Bucket: GrantsUserListObjects}) if err != nil { t.Fatalf("the grants part's object bucket: %v", err)