Skip to content

Commit

Permalink
feat: add Service type to BJJ did
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratap2018 committed Oct 1, 2024
1 parent 5b3fab3 commit 779d609
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions x/ssi/ld-context/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions x/ssi/tests/verification_method_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 779d609

Please sign in to comment.