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
feat: add Service type to BJJ did
Pratap2018 committed Oct 1, 2024
commit 779d609f09a70473678eaffe2d4c53802d2c443c
2 changes: 2 additions & 0 deletions x/ssi/ld-context/types.go
Original file line number Diff line number Diff line change
@@ -297,6 +297,7 @@ type JsonLdDidDocumentWithoutVM struct {
CapabilityInvocation []verificationMethodWithoutController `json:"capabilityInvocation,omitempty"`
KeyAgreement []verificationMethodWithoutController `json:"keyAgreement,omitempty"`
Proof JsonLdDocumentProof `json:"proof,omitempty"`
Service []*types.Service `protobuf:"bytes,11,rep,name=service,proto3" json:"service,omitempty"`
}

func (doc *JsonLdDidDocumentWithoutVM) GetContext() []contextObject {
@@ -370,6 +371,7 @@ func NewJsonLdDidDocumentWithoutVM(didDoc *types.DidDocument, docProof *types.Do
jsonLdDoc.Proof.Created = docProof.Created
jsonLdDoc.Proof.ProofPurpose = docProof.ProofPurpose
jsonLdDoc.Proof.VerificationMethod = docProof.VerificationMethod + docProof.ProofPurpose
jsonLdDoc.Service = didDoc.Service
return jsonLdDoc
}

4 changes: 2 additions & 2 deletions x/ssi/tests/verification_method_test.go
Original file line number Diff line number Diff line change
@@ -260,7 +260,7 @@ func TestBJJAndEd25519(t *testing.T) {

var service types.Service
service.Id = alice_didDoc.Id + "#ServiceTypeAny"
service.Type = "ServiceTypeAny"
service.Type = "service"
service.ServiceEndpoint = "https://example.com"
alice_didDoc.Service = append(alice_didDoc.Service, &service)

@@ -310,7 +310,7 @@ func TestEd25519AndBJJ(t *testing.T) {
alice_kp.VerificationMethodId = alice_didDoc.VerificationMethod[0].Id
var service types.Service
service.Id = alice_didDoc.Id + "#ServiceType"
service.Type = "ServiceType"
service.Type = "service"
service.ServiceEndpoint = "https://example.com"
alice_didDoc.Service = append(alice_didDoc.Service, &service)


Unchanged files with check annotations Beta

err := bankKeeper.SendCoinsFromAccountToModule(ctx, acc.GetAddress(), types.FeeCollectorName, fees)
if err != nil {
return errors.Wrapf(sdkerrors.ErrInsufficientFunds, err.Error())

Check failure on line 208 in x/ssi/ante/decorators.go

GitHub Actions / Golang Lint

printf: non-constant format string in call to cosmossdk.io/errors.Wrapf (govet)
}
return nil
issuanceDate := msgCredStatus.GetIssuanceDate()
issuanceDateParsed, err := time.Parse(time.RFC3339, issuanceDate)
if err != nil {
return nil, errors.Wrapf(types.ErrInvalidDate, fmt.Sprintf("invalid issuance date format: %s", issuanceDate))

Check failure on line 54 in x/ssi/keeper/msg_server_create_credential.go

GitHub Actions / Golang Lint

printf: non-constant format string in call to cosmossdk.io/errors.Wrapf (govet)
}
// Check if the created date before issuance date
// Validate Merkle Root Hash
if err := verifyCredentialMerkleRootHash(msgCredStatus.GetCredentialMerkleRootHash()); err != nil {
return nil, errors.Wrapf(types.ErrInvalidCredentialMerkleRootHash, err.Error())

Check failure on line 68 in x/ssi/keeper/msg_server_create_credential.go

GitHub Actions / Golang Lint

printf: non-constant format string in call to cosmossdk.io/errors.Wrapf (govet)
}
// Validate Document Proof