Skip to content

Commit

Permalink
fix: fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
edytapawlak committed May 15, 2024
1 parent 1e9d5a0 commit 576056a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ mod test {
witness1.witness_data.event_storage.get_kel_messages_with_receipts(&identifier.id, None)?.unwrap().as_slice(),
[Notice::Event(evt), Notice::NontransferableRct(rct)]
if matches!(evt.event_message.data.event_data, EventData::Icp(_))
&& matches!(rct.signatures.len(), 3) // TODO: fix witness to not insert duplicate signatures
&& matches!(rct.signatures.len(), 2)
));

Ok(())
Expand Down
11 changes: 7 additions & 4 deletions keriox_core/src/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,17 @@ impl SledEventDatabase {
let receipt_body = receipt.body;
let sigs = receipt.signatures;
for sig in sigs {
let single_receipt = SignedNontransferableReceipt { body: receipt_body.clone(), signatures: vec![sig] };
let single_receipt = SignedNontransferableReceipt {
body: receipt_body.clone(),
signatures: vec![sig],
};
if !self.receipts_nt.contains_value(&single_receipt) {
self.receipts_nt.push(self.identifiers.designated_key(id)?, single_receipt)?;
self.receipts_nt
.push(self.identifiers.designated_key(id)?, single_receipt)?;
self.db.flush()?;
}
};
}
Ok(())

}

pub fn get_receipts_nt(
Expand Down

0 comments on commit 576056a

Please sign in to comment.