From 4f3c8334bea70f0d9dbbb874624d36c5645db08b Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Wed, 7 Sep 2022 19:49:54 +0300 Subject: [PATCH] change proto generator to std gogo: fix tests --- .../treestoragebuilder/treestoragebuilder.go | 14 +++++++------- .../treestoragebuildergraph_nix.go | 2 +- pkg/acl/tree/treegraph_nix.go | 2 +- service/space/space.go | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/acl/testutils/treestoragebuilder/treestoragebuilder.go b/pkg/acl/testutils/treestoragebuilder/treestoragebuilder.go index 3b7c6f7d..162a3f5f 100644 --- a/pkg/acl/testutils/treestoragebuilder/treestoragebuilder.go +++ b/pkg/acl/testutils/treestoragebuilder/treestoragebuilder.go @@ -361,7 +361,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha } convCh = &aclpb.ACLChange_ACLContentValue{ - Value: &aclpb.ACLChange_ACLContentValueValueOfUserJoin{ + Value: &aclpb.ACLChange_ACLContent_Value_UserJoin{ UserJoin: &aclpb.ACLChange_UserJoin{ Identity: t.keychain.GetIdentity(join.Identity), EncryptionKey: rawKey, @@ -379,7 +379,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha rawEncKey, _ := encKey.GetPublic().Raw() convCh = &aclpb.ACLChange_ACLContentValue{ - Value: &aclpb.ACLChange_ACLContentValueValueOfUserInvite{ + Value: &aclpb.ACLChange_ACLContent_Value_UserInvite{ UserInvite: &aclpb.ACLChange_UserInvite{ AcceptPublicKey: rawAcceptKey, EncryptPublicKey: rawEncKey, @@ -393,7 +393,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha confirm := ch.UserConfirm convCh = &aclpb.ACLChange_ACLContentValue{ - Value: &aclpb.ACLChange_ACLContentValueValueOfUserConfirm{ + Value: &aclpb.ACLChange_ACLContent_Value_UserConfirm{ UserConfirm: &aclpb.ACLChange_UserConfirm{ Identity: t.keychain.GetIdentity(confirm.Identity), UserAddId: confirm.UserAddId, @@ -404,7 +404,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha permissionChange := ch.UserPermissionChange convCh = &aclpb.ACLChange_ACLContentValue{ - Value: &aclpb.ACLChange_ACLContentValueValueOfUserPermissionChange{ + Value: &aclpb.ACLChange_ACLContent_Value_UserPermissionChange{ UserPermissionChange: &aclpb.ACLChange_UserPermissionChange{ Identity: t.keychain.GetIdentity(permissionChange.Identity), Permissions: t.convertPermission(permissionChange.Permission), @@ -416,7 +416,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha newReadKey := t.keychain.GetKey(remove.NewReadKey).(*SymKey) - var replaces []*aclpb.ACLChangeReadKeyReplace + var replaces []*aclpb.ACLChange_ReadKeyReplace for _, id := range remove.IdentitiesLeft { identity := t.keychain.GetIdentity(id) encKey := t.keychain.EncryptionKeys[id] @@ -425,7 +425,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha if err != nil { panic(err) } - replaces = append(replaces, &aclpb.ACLChangeReadKeyReplace{ + replaces = append(replaces, &aclpb.ACLChange_ReadKeyReplace{ Identity: identity, EncryptionKey: rawEncKey, EncryptedReadKey: encReadKey, @@ -433,7 +433,7 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha } convCh = &aclpb.ACLChange_ACLContentValue{ - Value: &aclpb.ACLChange_ACLContentValueValueOfUserRemove{ + Value: &aclpb.ACLChange_ACLContent_Value_UserRemove{ UserRemove: &aclpb.ACLChange_UserRemove{ Identity: t.keychain.GetIdentity(remove.RemovedIdentity), ReadKeyReplaces: replaces, diff --git a/pkg/acl/testutils/treestoragebuilder/treestoragebuildergraph_nix.go b/pkg/acl/testutils/treestoragebuilder/treestoragebuildergraph_nix.go index 9d973a24..a68cb0a1 100644 --- a/pkg/acl/testutils/treestoragebuilder/treestoragebuildergraph_nix.go +++ b/pkg/acl/testutils/treestoragebuilder/treestoragebuildergraph_nix.go @@ -66,7 +66,7 @@ func (t *TreeStorageBuilder) Graph() (string, error) { if r.GetAclData() != nil { for _, chc := range r.GetAclData().AclContent { tp := fmt.Sprintf("%T", chc.Value) - tp = strings.Replace(tp, "ACLChange_ACLContentValueValueOf", "", 1) + tp = strings.Replace(tp, "ACLChange_ACLContent_Value_", "", 1) res := "" for _, ts := range tp { if unicode.IsUpper(ts) { diff --git a/pkg/acl/tree/treegraph_nix.go b/pkg/acl/tree/treegraph_nix.go index 72dc0c7d..68382fad 100644 --- a/pkg/acl/tree/treegraph_nix.go +++ b/pkg/acl/tree/treegraph_nix.go @@ -60,7 +60,7 @@ func (t *Tree) Graph() (data string, err error) { if c.Content.AclData != nil { for _, chc := range c.Content.AclData.AclContent { tp := fmt.Sprintf("%T", chc.Value) - tp = strings.Replace(tp, "ACLChange_ACLContentValueValueOf", "", 1) + tp = strings.Replace(tp, "ACLChange_ACLContent_Value_", "", 1) res := "" for _, ts := range tp { if unicode.IsUpper(ts) { diff --git a/service/space/space.go b/service/space/space.go index 272073bf..182aef30 100644 --- a/service/space/space.go +++ b/service/space/space.go @@ -70,8 +70,8 @@ func (s *space) Handle(ctx context.Context, msg *spacesync.Space) (repl *spacesy if er != nil { return nil, er } - return &spacesync.Space{SpaceId: s.id, Message: &spacesync.SpaceContent{ - Value: &spacesync.SpaceContent_Value_DiffRange{ + return &spacesync.Space{SpaceId: s.id, Message: &spacesync.Space_Content{ + Value: &spacesync.Space_Content_DiffRange{ DiffRange: resp, }, }}, nil