Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bjj signature fix #393

Merged
merged 14 commits into from
Oct 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: remove isBabyJubJubKey2021PresentAlongWithOtherVMTypes meth…
…od as it's unuserd
Pratap2018 committed Sep 30, 2024
commit e2e889b2e567908e313c794f795b682c002661ca
36 changes: 18 additions & 18 deletions x/ssi/types/diddoc_validation.go
Original file line number Diff line number Diff line change
@@ -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 {