Updates statement funcs to adapt changes from multi-token env.
This commit is contained in:
parent
07c90cc7e5
commit
c7dd285bbb
@ -58,9 +58,11 @@ def get_cached_statement(blockchain_address: str) -> bytes:
|
|||||||
return get_cached_data(key=key)
|
return get_cached_data(key=key)
|
||||||
|
|
||||||
|
|
||||||
def parse_statement_transactions(statement: list):
|
def parse_statement_transactions(decimals: int, statement: list):
|
||||||
"""This function extracts information for transaction objects loaded from the redis cache and structures the data in
|
"""This function extracts information for transaction objects loaded from the redis cache and structures the data in
|
||||||
a format that is appropriate for the ussd interface.
|
a format that is appropriate for the ussd interface.
|
||||||
|
:param decimals:
|
||||||
|
:type decimals: int
|
||||||
:param statement: A list of transaction objects.
|
:param statement: A list of transaction objects.
|
||||||
:type statement: list
|
:type statement: list
|
||||||
:return:
|
:return:
|
||||||
@ -69,7 +71,7 @@ def parse_statement_transactions(statement: list):
|
|||||||
parsed_transactions = []
|
parsed_transactions = []
|
||||||
for transaction in statement:
|
for transaction in statement:
|
||||||
action_tag = transaction.get('action_tag')
|
action_tag = transaction.get('action_tag')
|
||||||
amount = from_wei(transaction.get('token_value'))
|
amount = from_wei(decimals, transaction.get('token_value'))
|
||||||
direction_tag = transaction.get('direction_tag')
|
direction_tag = transaction.get('direction_tag')
|
||||||
token_symbol = transaction.get('token_symbol')
|
token_symbol = transaction.get('token_symbol')
|
||||||
metadata_id = transaction.get('metadata_id')
|
metadata_id = transaction.get('metadata_id')
|
||||||
|
Loading…
Reference in New Issue
Block a user