Skip to content

Commit 4748a2b

Browse files
authored
Merge pull request openwallet-foundation#1990 from ianco/alice-job-fix
Fixes to acme exercise code
2 parents 4696a26 + 774a821 commit 4748a2b

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

demo/AcmeDemoWorkshop.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ from uuid import uuid4
6161

6262
``` python
6363
TAILS_FILE_COUNT = int(os.getenv("TAILS_FILE_COUNT", 100))
64-
CRED_PREVIEW_TYPE = (
65-
"did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/2.0/credential-preview"
66-
)
64+
CRED_PREVIEW_TYPE = "https://didcomm.org/issue-credential/2.0/credential-preview"
6765
```
6866

6967
Next locate the code that is triggered by option ```2```:
@@ -142,18 +140,24 @@ then replace the ```# TODO``` comment and the ```pass``` statement:
142140
if is_proof_of_education:
143141
log_status("#28.1 Received proof of education, check claims")
144142
for (referent, attr_spec) in pres_req["requested_attributes"].items():
145-
self.log(
146-
f"{attr_spec['name']}: "
147-
f"{pres['requested_proof']['revealed_attrs'][referent]['raw']}"
148-
)
143+
if referent in pres['requested_proof']['revealed_attrs']:
144+
self.log(
145+
f"{attr_spec['name']}: "
146+
f"{pres['requested_proof']['revealed_attrs'][referent]['raw']}"
147+
)
148+
else:
149+
self.log(
150+
f"{attr_spec['name']}: "
151+
"(attribute not revealed)"
152+
)
149153
for id_spec in pres["identifiers"]:
150154
# just print out the schema/cred def id's of presented claims
151155
self.log(f"schema_id: {id_spec['schema_id']}")
152156
self.log(f"cred_def_id {id_spec['cred_def_id']}")
153157
# TODO placeholder for the next step
154158
else:
155159
# in case there are any other kinds of proofs received
156-
self.log("#28.1 Received ", message["presentation_request"]["name"])
160+
self.log("#28.1 Received ", pres_req["name"])
157161
```
158162

159163
Right now this just verifies the proof received and prints out the attributes it reveals, but in "real life" your application could do something useful with this information.

0 commit comments

Comments
 (0)