Skip to content
Snippets Groups Projects
Commit c362840e authored by Vincent Texier's avatar Vincent Texier
Browse files

Add wot/identity_of in bma api

parent ba1c879a
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment