1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 23:08:14 +00:00

ethereum: files rename

This commit is contained in:
Tomas Susanka 2017-12-22 16:17:32 +01:00
parent 19ef1480d8
commit 688b568bd9
4 changed files with 11 additions and 11 deletions

View File

@ -6,13 +6,13 @@ from trezor.messages.wire_types import \
@unimport
def dispatch_EthereumGetAddress(*args, **kwargs):
from .ethereum_get_address import layout_ethereum_get_address
from .get_address import layout_ethereum_get_address
return layout_ethereum_get_address(*args, **kwargs)
@unimport
def dispatch_EthereumSignTx(*args, **kwargs):
from .ethereum_sign_tx import ethereum_sign_tx
from .sign_tx import ethereum_sign_tx
return ethereum_sign_tx(*args, **kwargs)

View File

@ -1,28 +1,28 @@
from common import *
from apps.ethereum import ethereum_sign_tx
from apps.ethereum import sign_tx
class TestEthereumSignTx(unittest.TestCase):
def test_format(self):
text = ethereum_sign_tx.format_amount((1).to_bytes(5, 'little'), None, 1)
text = sign_tx.format_amount((1).to_bytes(5, 'little'), None, 1)
self.assertEqual(text, '1 Wei')
text = ethereum_sign_tx.format_amount((1000).to_bytes(5, 'little'), None, 1)
text = sign_tx.format_amount((1000).to_bytes(5, 'little'), None, 1)
self.assertEqual(text, '1000 Wei')
text = ethereum_sign_tx.format_amount((1000000000000000001).to_bytes(20, 'little'), None, 1)
text = sign_tx.format_amount((1000000000000000001).to_bytes(20, 'little'), None, 1)
self.assertEqual(text, '1 ETH')
text = ethereum_sign_tx.format_amount((10000000000000000001).to_bytes(20, 'little'), None, 1)
text = sign_tx.format_amount((10000000000000000001).to_bytes(20, 'little'), None, 1)
self.assertEqual(text, '10 ETH')
text = ethereum_sign_tx.format_amount((10000000000000000001).to_bytes(20, 'little'), None, 61)
text = sign_tx.format_amount((10000000000000000001).to_bytes(20, 'little'), None, 61)
self.assertEqual(text, '10 ETC')
text = ethereum_sign_tx.format_amount((1000000000000000001).to_bytes(20, 'little'), None, 31)
text = sign_tx.format_amount((1000000000000000001).to_bytes(20, 'little'), None, 31)
self.assertEqual(text, '1 tRSK')
# unknown chain
text = ethereum_sign_tx.format_amount((1).to_bytes(20, 'little'), None, 9999)
text = sign_tx.format_amount((1).to_bytes(20, 'little'), None, 9999)
self.assertEqual(text, '1 Wei')
text = ethereum_sign_tx.format_amount((10000000000000000001).to_bytes(20, 'little'), None, 9999)
text = sign_tx.format_amount((10000000000000000001).to_bytes(20, 'little'), None, 9999)
self.assertEqual(text, '10 UNKN')