From dc454eeec89199d685f57aa4937f5a7b9bde9923 Mon Sep 17 00:00:00 2001 From: PhilipWafula Date: Mon, 22 Nov 2021 19:53:46 +0300 Subject: [PATCH] Removes superfluous logging. --- apps/cic-ussd/cic_ussd/account/tokens.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/apps/cic-ussd/cic_ussd/account/tokens.py b/apps/cic-ussd/cic_ussd/account/tokens.py index bc0fda0a..4ffeb57b 100644 --- a/apps/cic-ussd/cic_ussd/account/tokens.py +++ b/apps/cic-ussd/cic_ussd/account/tokens.py @@ -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) token_balance = get_cached_available_balance(decimals=decimals, identifier=identifier) entry['balance'] = token_balance - logg.debug(f'APPENDING: {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)) - logg.debug(f'ORDERED ACCOUNT TOKENS LIST: {account_tokens_list}') key = cache_data_key(bytes.fromhex(blockchain_address), MetadataPointer.TOKEN_DATA_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: :rtype: """ - logg.debug(f'RECEIVED ACCOUNT TOKENS LIST: {account_tokens_list}') ordered_tokens_list = [] # get last sent token key = cache_data_key(identifier=identifier, salt=MetadataPointer.TOKEN_LAST_SENT) last_sent_token_symbol = get_cached_data(key) - logg.debug(f'LAST SENT TOKEN: {last_sent_token_symbol}') # get last received token key = cache_data_key(identifier=identifier, salt=MetadataPointer.TOKEN_LAST_RECEIVED) 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) if last_sent_token_data: 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) if last_received_token_data: 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 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