chore_: log revealed addresses on join/edit (#5073)
This commit is contained in:
parent
70a9996d82
commit
0ef4fb8cc7
|
@ -4914,8 +4914,18 @@ func (m *Manager) saveAndPublish(community *Community) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Manager) GetRevealedAddresses(communityID types.HexBytes, memberPk string) ([]*protobuf.RevealedAccount, error) {
|
func (m *Manager) GetRevealedAddresses(communityID types.HexBytes, memberPk string) ([]*protobuf.RevealedAccount, error) {
|
||||||
|
logger := m.logger.Named("GetRevealedAddresses")
|
||||||
|
|
||||||
requestID := CalculateRequestID(memberPk, communityID)
|
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,
|
func (m *Manager) ReevaluatePrivilegedMember(community *Community, tokenPermissions []*CommunityTokenPermission,
|
||||||
|
|
|
@ -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`
|
// 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.
|
// is not an error, but it should be.
|
||||||
logger := m.logger.Named("RequestToJoinCommunity")
|
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 {
|
if err := request.Validate(len(request.AddressesToReveal) > 0); err != nil {
|
||||||
logger.Debug("request failed to validate", zap.Error(err), zap.Any("request", request))
|
logger.Debug("request failed to validate", zap.Error(err), zap.Any("request", request))
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue