Skip to content
Snippets Groups Projects
Commit 98127adb authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

wip

parent 21d5cee7
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@
},
{
"HugoTrentesaux": {
"session_keys": "dummy",
"certs_received": [
"elois",
"tuxmain",
......
......@@ -53,6 +53,8 @@ def get_identities_and_wallets(start_timestamp):
# Get custom identities
custom_identities = load_json("custom/identities.json")
# TODO manage membership expiration
# TODO make sure that index respects order of arrival
# Get identities names by pubkey
for i, idty in enumerate(idty_data):
pubkey = idty["key"]
......@@ -60,16 +62,12 @@ def get_identities_and_wallets(start_timestamp):
value = idty["value"][0]
uid = value["uid"]
identity_names[pubkey] = uid
identities[uid] = {
"index": i,
"owner_key": address,
"balance": 0,
"membership_expire_on": 0,
"next_cert_issuable_on": 0,
"certs_received": {},
}
# TODO depending if member manage membership expiration
# TODO make sure that index respects order of arrival
# FIXME
if value["member"]:
membership_expire_on = 666
else:
membership_expire_on = 0
# add address and balance to identity
if address not in wallets:
......@@ -80,6 +78,16 @@ def get_identities_and_wallets(start_timestamp):
# (only let simple wallets)
del wallets[address]
# fill in identity entry
identities[uid] = {
"index": i,
"owner_key": address,
"balance": balance,
"membership_expire_on": membership_expire_on,
"next_cert_issuable_on": 0,
"certs_received": {},
}
# Switch address to custom if exist
if uid in addresses_switches.keys():
identities[uid]["owner_key"] = addresses_switches[uid]["v2"]
......@@ -87,9 +95,6 @@ def get_identities_and_wallets(start_timestamp):
addresses_switches[uid]["v1"]
)
identities[uid]["balance"] = balance
identities[uid]["pubkey"] = address
# Add custom identities
identities.update(custom_identities)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment