chore_: log revealed addresses on join/edit (#5073)

This commit is contained in:
Ajay Sivan 2024-04-25 07:24:25 +05:30 committed by GitHub
parent 70a9996d82
commit 0ef4fb8cc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View File

@ -4914,8 +4914,18 @@ func (m *Manager) saveAndPublish(community *Community) error {
}
func (m *Manager) GetRevealedAddresses(communityID types.HexBytes, memberPk string) ([]*protobuf.RevealedAccount, error) {
logger := m.logger.Named("GetRevealedAddresses")
requestID := CalculateRequestID(memberPk, communityID)
return m.persistence.GetRequestToJoinRevealedAddresses(requestID)
response, err := m.persistence.GetRequestToJoinRevealedAddresses(requestID)
revealedAddresses := make([]string, len(response))
for i, acc := range response {
revealedAddresses[i] = acc.Address
}
logger.Debug("Revealed addresses", zap.Any("Addresses:", revealedAddresses))
return response, err
}
func (m *Manager) ReevaluatePrivilegedMember(community *Community, tokenPermissions []*CommunityTokenPermission,

View File

@ -1227,6 +1227,8 @@ func (m *Messenger) RequestToJoinCommunity(request *requests.RequestToJoinCommun
// TODO: Because of changes that need to be done in tests, calling this function and providing `request` without `AddressesToReveal`
// is not an error, but it should be.
logger := m.logger.Named("RequestToJoinCommunity")
logger.Debug("Addresses to reveal", zap.Any("Addresses:", request.AddressesToReveal))
if err := request.Validate(len(request.AddressesToReveal) > 0); err != nil {
logger.Debug("request failed to validate", zap.Error(err), zap.Any("request", request))
return nil, err