diff --git a/duniterpy/api/bma/wot.py b/duniterpy/api/bma/wot.py index 1599900384cae85e740e548c5bf9ad535100d8e2..94422413a450cf3c9ae3493d684b5824cbdaaae9 100644 --- a/duniterpy/api/bma/wot.py +++ b/duniterpy/api/bma/wot.py @@ -298,6 +298,21 @@ LOOKUP_SCHEMA = { "required": ["partial", "results"] } +IDENTITY_OF_SCHEMA = { + "type": "object", + "properties": { + "pubkey": { + "type": "string" + }, + "uid": { + "type": "string" + }, + "sigDate": { + "type": "string" + } + } +} + async def add(client: Client, identity_signed_raw: str) -> ClientResponse: """ @@ -384,3 +399,14 @@ async def requirements(client: Client, search: str) -> dict: :return: """ return await client.get(MODULE + '/requirements/%s' % search, schema=REQUIREMENTS_SCHEMA) + + +async def identity_of(client: Client, search: str) -> dict: + """ + GET Identity data written in the blockchain + + :param client: Client to connect to the api + :param search: UID or public key + :return: + """ + return await client.get(MODULE + '/identity-of/%s' % search, schema=IDENTITY_OF_SCHEMA) diff --git a/tests/api/bma/test_tx.py b/tests/api/bma/test_tx.py index e9d7676ba080360416eb7f31a99f2f166f5c3db1..f44a888c9bca40d1f9b3b6f5a55aa37d006f04a6 100644 --- a/tests/api/bma/test_tx.py +++ b/tests/api/bma/test_tx.py @@ -117,7 +117,27 @@ class TestBmaTx(WebFunctionalSetupMixin, unittest.TestCase): ], "hash": "A0A511131CD0E837204A9441B3354918AC4CE671" } - ] + ], + "pending": [ + { + "version": 1, + "issuers": [ + "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk" + ], + "inputs": [ + "0:D:8196:000022AD426FE727C707D847EC2168A64C577706:5872" + ], + "outputs": [ + "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk:5871" + "2sq8bBDQGK74f1eD3mAPQVgHCmFdijZr9nbv16FwbokX:1", + ], + "comment": "some comment", + "signatures": [ + "kLOAAy7/UldQk7zz4I7Jhv9ICuGYRx7upl8wH8RYL43MMF6+7MbPh3QRN1qNFGpAfa3XMWIQmbUWtjZKP6OfDA==" + ], + "hash": "BA41013F2CD38EDFFA9D38A275F8532DD906A2DE" + } + ], } } jsonschema.validate(json_sample, HISTORY_SCHEMA)