From 6fbfbbdcb8c47981bb01b0f9fdbab19afee9761c Mon Sep 17 00:00:00 2001 From: Harsh Multani Date: Fri, 7 May 2021 02:03:49 +0530 Subject: [PATCH] Fixed Merge Conflicts Signed-off-by: Harsh Multani --- .../endorse_transaction/v1_0/routes.py | 11 ------ .../v1_0/tests/test_routes.py | 39 ------------------- 2 files changed, 50 deletions(-) diff --git a/aries_cloudagent/protocols/endorse_transaction/v1_0/routes.py b/aries_cloudagent/protocols/endorse_transaction/v1_0/routes.py index 7331a3d48b..39da9932ea 100644 --- a/aries_cloudagent/protocols/endorse_transaction/v1_0/routes.py +++ b/aries_cloudagent/protocols/endorse_transaction/v1_0/routes.py @@ -666,13 +666,6 @@ async def set_endorser_info(request: web.BaseRequest): " in connection metadata for this connection record" ) ) - if "transaction_their_job" not in jobs.keys(): - raise web.HTTPForbidden( - reason=( - 'Ask the other agent to set up "transaction_my_job" in ' - '"transaction_jobs" in connection metadata for their connection record' - ) - ) if jobs["transaction_my_job"] != TransactionJob.TRANSACTION_AUTHOR.name: raise web.HTTPForbidden( reason=( @@ -680,10 +673,6 @@ async def set_endorser_info(request: web.BaseRequest): "to metadata of its connection record" ) ) - if jobs["transaction_their_job"] != TransactionJob.TRANSACTION_ENDORSER.name: - raise web.HTTPForbidden( - reason="The Other agent should have job TRANSACTION_ENDORSER" - ) value = await record.metadata_get(session, "endorser_info") if value: value["endorser_did"] = endorser_did diff --git a/aries_cloudagent/protocols/endorse_transaction/v1_0/tests/test_routes.py b/aries_cloudagent/protocols/endorse_transaction/v1_0/tests/test_routes.py index 2de5d3416c..d1f754c7ad 100644 --- a/aries_cloudagent/protocols/endorse_transaction/v1_0/tests/test_routes.py +++ b/aries_cloudagent/protocols/endorse_transaction/v1_0/tests/test_routes.py @@ -1427,25 +1427,6 @@ async def test_set_endorser_info_no_transaction_my_job_x(self): with self.assertRaises(test_module.web.HTTPForbidden): await test_module.set_endorser_info(self.request) - async def test_set_endorser_info_no_transaction_their_job_x(self): - self.request.match_info = {"conn_id": "dummy"} - self.request.query = {"endorser_did": "did", "endorser_name": "name"} - - with async_mock.patch.object( - ConnRecord, "retrieve_by_id", async_mock.CoroutineMock() - ) as mock_conn_rec_retrieve: - mock_conn_rec_retrieve.return_value = async_mock.MagicMock( - metadata_get=async_mock.CoroutineMock( - return_value={ - "transaction_my_job": ( - test_module.TransactionJob.TRANSACTION_AUTHOR.name - ), - } - ) - ) - with self.assertRaises(test_module.web.HTTPForbidden): - await test_module.set_endorser_info(self.request) - async def test_set_endorser_info_my_wrong_job_x(self): self.request.match_info = {"conn_id": "dummy"} self.request.query = {"endorser_did": "did", "endorser_name": "name"} @@ -1466,26 +1447,6 @@ async def test_set_endorser_info_my_wrong_job_x(self): with self.assertRaises(test_module.web.HTTPForbidden): await test_module.set_endorser_info(self.request) - async def test_set_endorser_info_their_wrong_job_x(self): - self.request.match_info = {"conn_id": "dummy"} - self.request.query = {"endorser_did": "did", "endorser_name": "name"} - with async_mock.patch.object( - ConnRecord, "retrieve_by_id", async_mock.CoroutineMock() - ) as mock_conn_rec_retrieve: - mock_conn_rec_retrieve.return_value = async_mock.MagicMock( - metadata_get=async_mock.CoroutineMock( - return_value={ - "transaction_my_job": ( - test_module.TransactionJob.TRANSACTION_AUTHOR.name - ), - "transaction_their_job": "a suffusion of yellow", - } - ) - ) - - with self.assertRaises(test_module.web.HTTPForbidden): - await test_module.set_endorser_info(self.request) - """ async def test_transaction_write_schema_txn(self): self.request.match_info = {"tran_id": "dummy"}