Skip to content

Commit

Permalink
refactor: remove isBabyJubJubKey2021PresentAlongWithOtherVMTypes meth…
Browse files Browse the repository at this point in the history
…od as it's unuserd
  • Loading branch information
Pratap2018 committed Sep 30, 2024
1 parent 656268c commit e2e889b
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions x/ssi/types/diddoc_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,24 +417,24 @@ func validateBlockchainAccountId(blockchainAccountId string) error {
}

// isBabyJubJubKey2021PresentAlongWithOtherVMTypes checks if both BabyJubJubKey2021 and other VM Types are present at once
func isBabyJubJubKey2021PresentAlongWithOtherVMTypes(verificationMethods []*VerificationMethod) error {
babyJubJubKey2021Count := 0
nonBabyJubJubKey2021Count := 0

for _, vm := range verificationMethods {
if vm.Type == BabyJubJubKey2021 {
babyJubJubKey2021Count += 1
} else {
nonBabyJubJubKey2021Count += 1
}
}

if babyJubJubKey2021Count > 0 && nonBabyJubJubKey2021Count > 0 {
return fmt.Errorf("BabyJubJubKey2021 should not be paired with other VM types in a single DID Document")
}

return nil
}
// func isBabyJubJubKey2021PresentAlongWithOtherVMTypes(verificationMethods []*VerificationMethod) error {
// babyJubJubKey2021Count := 0
// nonBabyJubJubKey2021Count := 0

// for _, vm := range verificationMethods {
// if vm.Type == BabyJubJubKey2021 {
// babyJubJubKey2021Count += 1
// } else {
// nonBabyJubJubKey2021Count += 1
// }
// }

// if babyJubJubKey2021Count > 0 && nonBabyJubJubKey2021Count > 0 {
// return fmt.Errorf("BabyJubJubKey2021 should not be paired with other VM types in a single DID Document")
// }

// return nil
// }

// ValidateDidDocument validates the DID Document
func (didDoc *DidDocument) ValidateDidDocument() error {
Expand Down

0 comments on commit e2e889b

Please sign in to comment.