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 c8d85bbfe..a5f371f6f 100644 --- a/protocol/communities/manager.go +++ b/protocol/communities/manager.go @@ -3924,7 +3924,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)) }