From f70b0f2c1bbd7aaed6a1a0b467cab8e9c7eeeba5 Mon Sep 17 00:00:00 2001 From: sklump Date: Fri, 21 Aug 2020 11:39:07 +0000 Subject: [PATCH] match get-did-list to response "public" schema spec and fix misleading description text Signed-off-by: sklump --- aries_cloudagent/wallet/routes.py | 4 ++-- aries_cloudagent/wallet/tests/test_routes.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aries_cloudagent/wallet/routes.py b/aries_cloudagent/wallet/routes.py index ca3a91281d..17b022284f 100644 --- a/aries_cloudagent/wallet/routes.py +++ b/aries_cloudagent/wallet/routes.py @@ -83,7 +83,7 @@ class DIDListQueryStringSchema(OpenAPISchema): required=False, **INDY_RAW_PUBLIC_KEY, ) - public = fields.Boolean(description="Whether DID is on the ledger", required=False) + public = fields.Boolean(description="Whether DID is public", required=False) class DIDQueryStringSchema(OpenAPISchema): @@ -106,7 +106,7 @@ def format_did_info(info: DIDInfo): return { "did": info.did, "verkey": info.verkey, - "public": json.dumps(bool(info.metadata.get("public"))), + "public": bool(info.metadata.get("public")), } diff --git a/aries_cloudagent/wallet/tests/test_routes.py b/aries_cloudagent/wallet/tests/test_routes.py index abbbc88d22..4192a22e8f 100644 --- a/aries_cloudagent/wallet/tests/test_routes.py +++ b/aries_cloudagent/wallet/tests/test_routes.py @@ -52,11 +52,11 @@ def test_format_did_info(self): assert ( result["did"] == self.test_did and result["verkey"] == self.test_verkey - and result["public"] == "false" + and result["public"] is False ) did_info = DIDInfo(self.test_did, self.test_verkey, {"public": True}) result = test_module.format_did_info(did_info) - assert result["public"] == "true" + assert result["public"] is True async def test_create_did(self): request = async_mock.MagicMock()