1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-27 01:48:17 +00:00

signing/eth: tokens fix

todo: add test
This commit is contained in:
Tomas Susanka 2018-02-19 16:31:26 +01:00
parent 3f63acdd77
commit b659f1b29c
2 changed files with 4 additions and 4 deletions

View File

@ -39,8 +39,8 @@ def split_address(address):
def format_ethereum_amount(value, token, chain_id):
value = int.from_bytes(value, 'big')
if token:
suffix = token.ticker
decimals = token.decimals
suffix = token['symbol']
decimals = token['decimal']
elif value < 1e18:
suffix = 'Wei'
decimals = 0

View File

@ -27,9 +27,9 @@ async def ethereum_sign_tx(ctx, msg):
token = tokens.token_by_chain_address(msg.chain_id, msg.to)
if token is None:
await layout.confirm_tx(ctx, msg.to, msg.value, msg.chain_id, token)
await layout.confirm_tx(ctx, msg.to, msg.value, msg.chain_id)
else:
await layout.confirm_tx(ctx, msg.data_initial_chunk[16:36], msg.data_initial_chunk.bytes[36:68], msg.chain_id, token)
await layout.confirm_tx(ctx, msg.data_initial_chunk[16:36], msg.data_initial_chunk[36:68], msg.chain_id, token)
if token is None and msg.data_length > 0:
await layout.confirm_data(ctx, msg.data_initial_chunk, data_total)