mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-27 16:48:09 +00:00
signing/eth: tokens fix
todo: add test
This commit is contained in:
parent
3f63acdd77
commit
b659f1b29c
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user