Merge branch 'philip/token-value-fix' into 'master'

Refactors to avoid conversion of zero values to wei.

See merge request grassrootseconomics/cic-internal-integration!279
This commit is contained in:
Philip Wafula 2021-09-22 08:17:39 +00:00
commit 0389d8623d
1 changed files with 2 additions and 1 deletions

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')