Skip to content

Commit 8c5e65c

Browse files
update explanatory comments
Signed-off-by: Andrew Whitehead <[email protected]>
1 parent d202eaf commit 8c5e65c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/services/types.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ pub(crate) struct PresentCredential<'p, T> {
154154
pub rev_state: Option<&'p CredentialRevocationState>,
155155
pub requested_attributes: HashSet<(String, bool)>,
156156
pub requested_predicates: HashSet<String>,
157-
pub link_secret: Option<&'p LinkSecret>,
157+
pub link_secret: Option<&'p LinkSecret>, // For testing only
158158
}
159159

160160
impl<T> PresentCredential<'_, T> {
@@ -190,6 +190,8 @@ impl<'a, 'p, T> AddCredential<'a, 'p, T> {
190190
self.present.requested_predicates.insert(referent.into());
191191
}
192192

193+
/// This method is intended for testing only, normally the link secret is
194+
/// passed directly when creating a presentation.
193195
pub fn set_link_secret(&mut self, link_secret: &'p LinkSecret) {
194196
self.present.link_secret.replace(link_secret);
195197
}

tests/anoncreds_demos.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,8 @@ fn anoncreds_demo_proof_does_not_verify_with_multiple_link_secrets() {
859859
&pres_request,
860860
presented,
861861
None,
862-
&prover_wallet_1.link_secret, // overridden in 'presented'
862+
// This link secret value is superseded by the ones assigned to each credential in 'presented'
863+
&prover_wallet_1.link_secret,
863864
&schemas,
864865
&cred_defs,
865866
)

0 commit comments

Comments
 (0)