chore(communities)_: rename `validateAndGetEventsMessageCommunityDescription`
This commit is contained in:
parent
6ed10bce81
commit
084a6e3c5c
|
@ -53,7 +53,7 @@ func (e *eventsProcessor) exec() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *eventsProcessor) validateDescription() 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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,7 @@ func (o *Community) addNewCommunityEvent(event *CommunityEvent) error {
|
||||||
// If there were no events before, extract CommunityDescription from CommunityDescriptionProtocolMessage
|
// If there were no events before, extract CommunityDescription from CommunityDescriptionProtocolMessage
|
||||||
// and check the signature
|
// and check the signature
|
||||||
if o.config.EventsData == nil || len(o.config.EventsData.EventsBaseCommunityDescription) == 0 {
|
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 {
|
if err != nil {
|
||||||
return err
|
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{}
|
metadata := &protobuf.ApplicationMetadataMessage{}
|
||||||
|
|
||||||
err := proto.Unmarshal(signedDescription, metadata)
|
err := proto.Unmarshal(signedDescription, metadata)
|
||||||
|
|
|
@ -3924,7 +3924,7 @@ func (m *Manager) dbRecordBundleToCommunity(r *CommunityRecordBundle) (*Communit
|
||||||
community.config.CommunityDescription = description
|
community.config.CommunityDescription = description
|
||||||
|
|
||||||
if community.config.EventsData != nil {
|
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 {
|
if err != nil {
|
||||||
m.logger.Error("invalid EventsBaseCommunityDescription", zap.Error(err))
|
m.logger.Error("invalid EventsBaseCommunityDescription", zap.Error(err))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue