mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-24 15:28:10 +00:00
ethereum: files rename
This commit is contained in:
parent
19ef1480d8
commit
688b568bd9
@ -6,13 +6,13 @@ from trezor.messages.wire_types import \
|
|||||||
|
|
||||||
@unimport
|
@unimport
|
||||||
def dispatch_EthereumGetAddress(*args, **kwargs):
|
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)
|
return layout_ethereum_get_address(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
@unimport
|
@unimport
|
||||||
def dispatch_EthereumSignTx(*args, **kwargs):
|
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)
|
return ethereum_sign_tx(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
from common import *
|
from common import *
|
||||||
from apps.ethereum import ethereum_sign_tx
|
from apps.ethereum import sign_tx
|
||||||
|
|
||||||
|
|
||||||
class TestEthereumSignTx(unittest.TestCase):
|
class TestEthereumSignTx(unittest.TestCase):
|
||||||
|
|
||||||
def test_format(self):
|
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')
|
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')
|
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')
|
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')
|
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')
|
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')
|
self.assertEqual(text, '1 tRSK')
|
||||||
|
|
||||||
# unknown chain
|
# 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')
|
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')
|
self.assertEqual(text, '10 UNKN')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user