diff --git a/generate_transactions_history.py b/generate_transactions_history.py index 52a92e8349a4509a2ec67fbab5bff5604c2b7c8c..998ae084608b3681e4207195a055d6a740b4a83e 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 ce687c1a288629890f7acdbea10e3d0792f29908..83b66068f71047cf81662d1f3629eaeb246cdd29 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