From a42efb2529bb3a188121d1a4294d83cab2324f99 Mon Sep 17 00:00:00 2001 From: nolash Date: Mon, 8 Nov 2021 10:43:02 +0100 Subject: [PATCH] Non-checksum address in erc20 tx_caches --- apps/cic-eth/cic_eth/eth/erc20.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/cic-eth/cic_eth/eth/erc20.py b/apps/cic-eth/cic_eth/eth/erc20.py index 4fbe2e57..40e2e0e8 100644 --- a/apps/cic-eth/cic_eth/eth/erc20.py +++ b/apps/cic-eth/cic_eth/eth/erc20.py @@ -382,6 +382,8 @@ def cache_transfer_data( sender_address = tx_normalize.wallet_address(tx['from']) recipient_address = tx_normalize.wallet_address(tx_data[0]) token_value = tx_data[1] + source_token_address = tx_normalize.executable_address(tx['to']) + destination_token_address = source_token_address session = SessionBase.create_session() @@ -389,8 +391,8 @@ def cache_transfer_data( 'hash': tx_hash_hex, 'from': sender_address, 'to': recipient_address, - 'source_token': tx['to'], - 'destination_token': tx['to'], + 'source_token': source_token_address, + 'destination_token': destination_token_address, 'from_value': token_value, 'to_value': token_value, } @@ -422,14 +424,16 @@ def cache_transfer_from_data( spender_address = tx_data[0] recipient_address = tx_data[1] token_value = tx_data[2] + source_token_address = tx_normalize.executable_address(tx['to']) + destination_token_address = source_token_address session = SessionBase.create_session() tx_dict = { 'hash': tx_hash_hex, 'from': tx['from'], 'to': recipient_address, - 'source_token': tx['to'], - 'destination_token': tx['to'], + 'source_token': source_token_address, + 'destination_token': destination_token_address, 'from_value': token_value, 'to_value': token_value, } @@ -461,14 +465,16 @@ def cache_approve_data( sender_address = tx_normalize.wallet_address(tx['from']) recipient_address = tx_normalize.wallet_address(tx_data[0]) token_value = tx_data[1] + source_token_address = tx_normalize.executable_address(tx['to']) + destination_token_address = source_token_address session = SessionBase.create_session() tx_dict = { 'hash': tx_hash_hex, 'from': sender_address, 'to': recipient_address, - 'source_token': tx['to'], - 'destination_token': tx['to'], + 'source_token': source_token_address, + 'destination_token': destination_token_address, 'from_value': token_value, 'to_value': token_value, }