Refactors to avoid conversion of zero values to wei.

This commit is contained in:
PhilipWafula 2021-09-22 11:10:33 +03:00
parent 79bcc8a9f1
commit cf64387d81
Signed by untrusted user: mango-habanero
GPG Key ID: B00CE9034DA19FB7

View File

@ -24,7 +24,8 @@ def transaction(notification_data: dict):
:rtype:
"""
role = notification_data.get('role')
amount = from_wei(notification_data.get('token_value'))
token_value = notification_data.get('token_value')
amount = token_value if token_value == 0 else from_wei(token_value)
balance = notification_data.get('available_balance')
phone_number = notification_data.get('phone_number')
preferred_language = notification_data.get('preferred_language')