diff --git a/silkaj/wot.py b/silkaj/wot.py index fa8fe2f7bf85e12ec75fc1146cc3da281800ba88..6270f71a130024ec6f9a568e9ce7cb457e08d19c 100644 --- a/silkaj/wot.py +++ b/silkaj/wot.py @@ -196,14 +196,12 @@ async def get_informations_for_identity(id): async def get_uid_from_pubkey(pubkey): try: client = ClientInstance().client - results = await client(wot.lookup, pubkey) + lookups = await client(wot.lookup, pubkey) except: return NO_MATCHING_ID - i, results = 0, results["results"] - while i < len(results): - if results[i]["uids"][0]["uid"] != pubkey: - return results[i]["uids"][0]["uid"] - i += 1 + for lookup in lookups["results"]: + if lookup["uids"][0]["uid"] != pubkey: + return lookup["uids"][0]["uid"] async def get_informations_for_identities(identifier):