chore(communities)_: rename `validateAndGetEventsMessageCommunityDescription`
This commit is contained in:
parent
d794e43347
commit
68e2202a6f
|
@ -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)
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue