Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-basiuk committed Feb 5, 2024
1 parent 13e926e commit 484da29
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ func checkIssuersEquality(issuers1, issuers2 []string) bool {
return true
}

type linkIdRequestId struct {
type linkIDRequestID struct {
linkID *big.Int
requestID uint32
}
Expand All @@ -408,7 +408,7 @@ func (v *Verifier) VerifyAuthResponse(
return err
}

groupIDToLinkIDMap := make(map[int][]linkIdRequestId)
groupIDToLinkIDMap := make(map[int][]linkIDRequestID)
for _, proofRequest := range request.Body.Scope {
// prepare query from request
query, err := unmarshalQuery(proofRequest.Query)
Expand Down Expand Up @@ -477,7 +477,7 @@ func (v *Verifier) VerifyAuthResponse(
return errors.Errorf("proof response doesn't contain from field")
}

err = verifyGroupIdMathch(pubSignals.LinkID, groupID, proofResponse.ID, groupIDToLinkIDMap)
err = verifyGroupIDMathch(pubSignals.LinkID, groupID, proofResponse.ID, groupIDToLinkIDMap)
if err != nil {
return err
}
Expand All @@ -487,17 +487,17 @@ func (v *Verifier) VerifyAuthResponse(
return nil
}

func verifyGroupIdMathch(linkID *big.Int, groupID int, requestID uint32, groupIDToLinkIDMap map[int][]linkIdRequestId) error {
func verifyGroupIDMathch(linkID *big.Int, groupID int, requestID uint32, groupIDToLinkIDMap map[int][]linkIDRequestID) error {
if groupID == 0 {
return nil
}
if linkID != nil {
if existingLinks, exists := groupIDToLinkIDMap[groupID]; exists {
linkIDMap := linkIdRequestId{linkID: linkID, requestID: requestID}
linkIDMap := linkIDRequestID{linkID: linkID, requestID: requestID}
groupIDToLinkIDMap[groupID] = append(existingLinks, linkIDMap)
} else {
linkIDMap := linkIdRequestId{linkID: linkID, requestID: requestID}
groupIDToLinkIDMap[groupID] = []linkIdRequestId{linkIDMap}
linkIDMap := linkIDRequestID{linkID: linkID, requestID: requestID}
groupIDToLinkIDMap[groupID] = []linkIDRequestID{linkIDMap}
}
}
// verify grouping links
Expand Down

0 comments on commit 484da29

Please sign in to comment.