Removes superfluous logging.
This commit is contained in:
parent
25f43a8e79
commit
dc454eeec8
@ -75,11 +75,8 @@ def create_account_tokens_list(blockchain_address: str):
|
|||||||
wait_for_cache(identifier, f'Cached available balance for token: {token_symbol}', MetadataPointer.BALANCES)
|
wait_for_cache(identifier, f'Cached available balance for token: {token_symbol}', MetadataPointer.BALANCES)
|
||||||
token_balance = get_cached_available_balance(decimals=decimals, identifier=identifier)
|
token_balance = get_cached_available_balance(decimals=decimals, identifier=identifier)
|
||||||
entry['balance'] = token_balance
|
entry['balance'] = token_balance
|
||||||
logg.debug(f'APPENDING: {entry}')
|
|
||||||
token_list_entries.append(entry)
|
token_list_entries.append(entry)
|
||||||
logg.debug(f'TOKEN LIST ENTRIES: {token_list_entries}')
|
|
||||||
account_tokens_list = order_account_tokens_list(token_list_entries, bytes.fromhex(blockchain_address))
|
account_tokens_list = order_account_tokens_list(token_list_entries, bytes.fromhex(blockchain_address))
|
||||||
logg.debug(f'ORDERED ACCOUNT TOKENS LIST: {account_tokens_list}')
|
|
||||||
key = cache_data_key(bytes.fromhex(blockchain_address), MetadataPointer.TOKEN_DATA_LIST)
|
key = cache_data_key(bytes.fromhex(blockchain_address), MetadataPointer.TOKEN_DATA_LIST)
|
||||||
cache_data(key, json.dumps(account_tokens_list))
|
cache_data(key, json.dumps(account_tokens_list))
|
||||||
|
|
||||||
@ -222,33 +219,25 @@ def order_account_tokens_list(account_tokens_list: list, identifier: bytes) -> l
|
|||||||
:return:
|
:return:
|
||||||
:rtype:
|
:rtype:
|
||||||
"""
|
"""
|
||||||
logg.debug(f'RECEIVED ACCOUNT TOKENS LIST: {account_tokens_list}')
|
|
||||||
ordered_tokens_list = []
|
ordered_tokens_list = []
|
||||||
# get last sent token
|
# get last sent token
|
||||||
key = cache_data_key(identifier=identifier, salt=MetadataPointer.TOKEN_LAST_SENT)
|
key = cache_data_key(identifier=identifier, salt=MetadataPointer.TOKEN_LAST_SENT)
|
||||||
last_sent_token_symbol = get_cached_data(key)
|
last_sent_token_symbol = get_cached_data(key)
|
||||||
logg.debug(f'LAST SENT TOKEN: {last_sent_token_symbol}')
|
|
||||||
|
|
||||||
# get last received token
|
# get last received token
|
||||||
key = cache_data_key(identifier=identifier, salt=MetadataPointer.TOKEN_LAST_RECEIVED)
|
key = cache_data_key(identifier=identifier, salt=MetadataPointer.TOKEN_LAST_RECEIVED)
|
||||||
last_received_token_symbol = get_cached_data(key)
|
last_received_token_symbol = get_cached_data(key)
|
||||||
logg.debug(f'LAST RECEIVED TOKEN: {last_received_token_symbol}')
|
|
||||||
|
|
||||||
last_sent_token_data, remaining_accounts_token_list = remove_from_account_tokens_list(account_tokens_list, last_sent_token_symbol)
|
last_sent_token_data, remaining_accounts_token_list = remove_from_account_tokens_list(account_tokens_list, last_sent_token_symbol)
|
||||||
if last_sent_token_data:
|
if last_sent_token_data:
|
||||||
ordered_tokens_list.append(last_sent_token_data[0])
|
ordered_tokens_list.append(last_sent_token_data[0])
|
||||||
logg.debug(f'ORDERED TOKEN LIST AFTER REMOVING SENT: {ordered_tokens_list}')
|
|
||||||
logg.debug(f'REMAINING TOKEN LIST AFTER REMOVING SENT: {remaining_accounts_token_list}')
|
|
||||||
|
|
||||||
last_received_token_data, remaining_accounts_token_list = remove_from_account_tokens_list(remaining_accounts_token_list, last_received_token_symbol)
|
last_received_token_data, remaining_accounts_token_list = remove_from_account_tokens_list(remaining_accounts_token_list, last_received_token_symbol)
|
||||||
if last_received_token_data:
|
if last_received_token_data:
|
||||||
ordered_tokens_list.append(last_received_token_data[0])
|
ordered_tokens_list.append(last_received_token_data[0])
|
||||||
logg.debug(f'ORDERED TOKEN LIST AFTER REMOVING RECEIVED: {ordered_tokens_list}')
|
|
||||||
logg.debug(f'REMAINING TOKEN LIST AFTER REMOVING SENT: {remaining_accounts_token_list}')
|
|
||||||
|
|
||||||
# order the by balance
|
# order the by balance
|
||||||
ordered_by_balance = sorted(remaining_accounts_token_list, key=lambda d: d['balance'], reverse=True)
|
ordered_by_balance = sorted(remaining_accounts_token_list, key=lambda d: d['balance'], reverse=True)
|
||||||
logg.debug(f'ORDERED BY BALANCE FOR REMAINING LIST: {ordered_by_balance}')
|
|
||||||
return ordered_tokens_list + ordered_by_balance
|
return ordered_tokens_list + ordered_by_balance
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user