From 867087522e20774aa8f2301ec89808207a544c2b Mon Sep 17 00:00:00 2001 From: Julien Fraichot Date: Mon, 27 Feb 2023 17:00:28 +0100 Subject: [PATCH] feat(ProofHandler): add concurrent proof --- tests/test_proof_handler.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/test_proof_handler.py b/tests/test_proof_handler.py index b23ef4ca..28461ee4 100644 --- a/tests/test_proof_handler.py +++ b/tests/test_proof_handler.py @@ -43,6 +43,35 @@ def test_single_signature_3_1_update_context_merkle_proof_2019(self): output = self.handler.add_proof(fixture_certificate_json, fixture_proof) self.assertIn(self.contextUrls.merkle_proof_2019(), output['@context']) + def test_multiple_non_chained_signature(self): + fixture_initial_proof = { + 'type': 'Ed25519Signature2020', + 'created': '2022-05-02T16:36:22.933Z', + 'verificationMethod': 'did:key:z6MkjHnntGvtLjwfAMHWTAXXGJHhVL3DPtaT9BHmyTjWpjqs#z6MkjHnntGvtLjwfAMHWTAXXGJHhVL3DPtaT9BHmyTjWpjqs', + 'proofPurpose': 'assertionMethod', + 'proofValue': 'zAvFt59599JweBZ4zPP6Ge8LhKgECtBvDRmjG5VQbgEkPCiyMcM9QAPanJgSCs6RRGcKu96qNpfmpe9eTygpFZP6' + } + fixture_certificate_json = { + '@context': [ + 'https://www.w3.org/2018/credentials/v1', + 'https://w3id.org/blockcerts/v3' + ], + 'kek': 'kek', + 'proof': fixture_initial_proof + } + fixture_proof = { + 'type': 'MerkleProof2019', + 'created': '2022-05-05T08:05:14.912828', + 'proofValue': 'zMcm4LfQFUZkWZyLJp1bqtXF8vkZZwp79x7Nvt5BmN2XV4usLLtDoeqiq3et923mcWfXde4a3m4f57yUZcATCbBXV1byb5AXbV8EzT6E8B9JKf3scvxxZCBVePtV4SrhYysAiLNJ9N2R8LgnpJ47wnQHkaTB1AMxrcLEHUTxm4zJTtQqf9orDLf3L4VoLzmST7ZzsDjuX9cw2hZ3Aazhhjy7swG44xfF1PC73SyCv77pDnJ6BSHm3azmbVG6BXv1EPtwF4J1YRqwojBEWk9nDgduACR7b9qNhQ46ND4B5vL8p3LkqTh', + 'proofPurpose': 'assertionMethod', + 'verificationMethod': 'did:ion:EiA_Z6LQILbB2zj_eVrqfQ2xDm4HNqeJUw5Kj2Z7bFOOeQ#key-1' + } + output = self.handler.add_proof(fixture_certificate_json, fixture_proof, False) + self.assertEqual(output['proof'], [ + fixture_initial_proof, + fixture_proof + ]) + def test_multiple_two_chained_signature(self): fixture_initial_proof = { 'type': 'Ed25519Signature2020',