From 779d609f09a70473678eaffe2d4c53802d2c443c Mon Sep 17 00:00:00 2001 From: Pratap2018 Date: Tue, 1 Oct 2024 17:33:19 +0530 Subject: [PATCH] feat: add Service type to BJJ did --- x/ssi/ld-context/types.go | 2 ++ x/ssi/tests/verification_method_test.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/x/ssi/ld-context/types.go b/x/ssi/ld-context/types.go index 0c45519..5c4a816 100644 --- a/x/ssi/ld-context/types.go +++ b/x/ssi/ld-context/types.go @@ -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 } diff --git a/x/ssi/tests/verification_method_test.go b/x/ssi/tests/verification_method_test.go index 65a40af..2e900e4 100644 --- a/x/ssi/tests/verification_method_test.go +++ b/x/ssi/tests/verification_method_test.go @@ -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)