Skip to content
Snippets Groups Projects
Commit c7432d85 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

fix: remove address switches

parent 92f9bc09
No related branches found
No related tags found
1 merge request!4import data from Duniter 1.8 leveldb database
......@@ -21,7 +21,6 @@ print("Generate v2s-indexer up-to-date Ğ1 history transactions")
history_final = {}
history_brut = load_json_url('inputs/transactions_history.json')
addresses_switches = load_json('custom/addresses_switches.json')
for transaction in history_brut:
written_time = transaction['time']
......@@ -38,12 +37,8 @@ for transaction in history_brut:
receiver_pubkey_lenght = len(receiver_pubkey_bytes)
if issuer_pubkey_lenght > 32 or receiver_pubkey_lenght > 32: continue
issuer = v1_pubkey_to_v2_address(issuer_v1)
receiver = v1_pubkey_to_v2_address(receiver_v1)
for switches in addresses_switches:
if issuer_v1 in switches['v1']: issuer = switches['v2']
if receiver_v1 in switches['v1']: receiver = switches['v2']
issuer = issuer_v1
receiver = receiver_v1
comment = transaction['comment']
......
......@@ -46,7 +46,7 @@ def get_wallets_data(leveldb_path: str) -> tuple:
ignored_money += balance
continue
wallets.update({v1_pubkey_to_v2_address(pubkey): int(balance)})
wallets.update({pubkey: int(balance)})
total_money += balance
return wallets, total_money, ignored_money
......@@ -80,8 +80,6 @@ def get_identities_and_wallets(start_timestamp: int, leveldb_path: str) -> tuple
certifications_repository = LevelDBCertificationsRepository(leveldb_path)
blocks_repository = LevelDBBlocksRepository(leveldb_path)
# Get identities switches
addresses_switches = load_json("custom/addresses_switches.json")
# Get custom identities
custom_identities = load_json("custom/identities.json")
......@@ -133,13 +131,6 @@ def get_identities_and_wallets(start_timestamp: int, leveldb_path: str) -> tuple
"certs_received": {},
}
# Switch address to custom if exist
if uid in addresses_switches.keys():
identities[uid]["owner_key"] = addresses_switches[uid]["v2"]
identities[uid]["old_owner_key"] = v1_pubkey_to_v2_address(
addresses_switches[uid]["v1"]
)
# Add custom identities
identities.update(custom_identities)
......@@ -150,7 +141,6 @@ def get_identities_and_wallets(start_timestamp: int, leveldb_path: str) -> tuple
# get certifications updated to their last state
for i_pubkey, issuer in certifications_repository:
i_uid = identity_names[i_pubkey]
i_address = v1_pubkey_to_v2_address(i_pubkey)
# get certifications updated to their last state
for cert in issuer["issued"]:
......@@ -160,7 +150,6 @@ def get_identities_and_wallets(start_timestamp: int, leveldb_path: str) -> tuple
r_pubkey = cert["receiver"]
r_uid = identity_names[r_pubkey]
r_address = v1_pubkey_to_v2_address(r_pubkey)
# get expiration of certification
# timestamp of cert creation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment