From c7432d856c6a912e8009e81afec666dedb5fa896 Mon Sep 17 00:00:00 2001 From: cgeek <cem.moreau@gmail.com> Date: Tue, 3 Oct 2023 13:22:03 +0200 Subject: [PATCH] fix: remove address switches --- generate_transactions_history.py | 9 ++------- lib/functions.py | 13 +------------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/generate_transactions_history.py b/generate_transactions_history.py index 52a92e8..998ae08 100755 --- a/generate_transactions_history.py +++ b/generate_transactions_history.py @@ -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'] diff --git a/lib/functions.py b/lib/functions.py index ce687c1..83b6606 100644 --- a/lib/functions.py +++ b/lib/functions.py @@ -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 -- GitLab