From 68e2202a6f4a6840913a6cffc8ba5a1fec3c22f8 Mon Sep 17 00:00:00 2001 From: Patryk Osmaczko Date: Wed, 25 Sep 2024 16:05:58 +0200 Subject: [PATCH] chore(communities)_: rename `validateAndGetEventsMessageCommunityDescription` --- protocol/communities/community_events_processing.go | 6 +++--- protocol/communities/manager.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/protocol/communities/community_events_processing.go b/protocol/communities/community_events_processing.go index 21ad716ed..147f63ae6 100644 --- a/protocol/communities/community_events_processing.go +++ b/protocol/communities/community_events_processing.go @@ -53,7 +53,7 @@ func (e *eventsProcessor) exec() error { } func (e *eventsProcessor) validateDescription() error { - description, err := validateAndGetEventsMessageCommunityDescription(e.message.EventsBaseCommunityDescription, e.community.ControlNode()) + description, err := unmarshalCommunityDescriptionMessage(e.message.EventsBaseCommunityDescription, e.community.ControlNode()) if err != nil { return err } @@ -285,7 +285,7 @@ func (o *Community) addNewCommunityEvent(event *CommunityEvent) error { // If there were no events before, extract CommunityDescription from CommunityDescriptionProtocolMessage // and check the signature if o.config.EventsData == nil || len(o.config.EventsData.EventsBaseCommunityDescription) == 0 { - _, err := validateAndGetEventsMessageCommunityDescription(o.config.CommunityDescriptionProtocolMessage, o.ControlNode()) + _, err := unmarshalCommunityDescriptionMessage(o.config.CommunityDescriptionProtocolMessage, o.ControlNode()) if err != nil { return err } @@ -314,7 +314,7 @@ func (o *Community) toCommunityEventsMessage() *CommunityEventsMessage { } } -func validateAndGetEventsMessageCommunityDescription(signedDescription []byte, signerPubkey *ecdsa.PublicKey) (*protobuf.CommunityDescription, error) { +func unmarshalCommunityDescriptionMessage(signedDescription []byte, signerPubkey *ecdsa.PublicKey) (*protobuf.CommunityDescription, error) { metadata := &protobuf.ApplicationMetadataMessage{} err := proto.Unmarshal(signedDescription, metadata) diff --git a/protocol/communities/manager.go b/protocol/communities/manager.go index 2133d1c25..d6dbbdf2a 100644 --- a/protocol/communities/manager.go +++ b/protocol/communities/manager.go @@ -3921,7 +3921,7 @@ func (m *Manager) dbRecordBundleToCommunity(r *CommunityRecordBundle) (*Communit community.config.CommunityDescription = description if community.config.EventsData != nil { - eventsDescription, err := validateAndGetEventsMessageCommunityDescription(community.config.EventsData.EventsBaseCommunityDescription, community.ControlNode()) + eventsDescription, err := unmarshalCommunityDescriptionMessage(community.config.EventsData.EventsBaseCommunityDescription, community.ControlNode()) if err != nil { m.logger.Error("invalid EventsBaseCommunityDescription", zap.Error(err)) }