change proto generator to std gogo: fix tests

This commit is contained in:
Sergey Cherepanov 2022-09-07 19:49:54 +03:00 committed by Mikhail Iudin
parent d157c561b7
commit 4f3c8334be
No known key found for this signature in database
GPG Key ID: FAAAA8BAABDFF1C0
4 changed files with 11 additions and 11 deletions

View File

@ -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,

View File

@ -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) {

View File

@ -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) {

View File

@ -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