2013-01-17 12:37:48 +00:00
|
|
|
import unittest
|
|
|
|
import common
|
|
|
|
|
2013-09-13 03:27:21 +00:00
|
|
|
class TestAddresses(common.TrezorTest):
|
|
|
|
def test_btc(self):
|
2014-01-12 15:16:07 +00:00
|
|
|
self.client.load_device_by_mnemonic(mnemonic=self.mnemonic1,
|
|
|
|
pin='',
|
|
|
|
passphrase_protection=False,
|
|
|
|
label='test',
|
|
|
|
language='english')
|
2013-01-17 12:37:48 +00:00
|
|
|
|
2014-01-12 15:16:07 +00:00
|
|
|
self.assertEqual(self.client.get_address('Bitcoin', []), '1EfKbQupktEMXf4gujJ9kCFo83k1iMqwqK')
|
|
|
|
self.assertEqual(self.client.get_address('Bitcoin', [1]), '1CK7SJdcb8z9HuvVft3D91HLpLC6KSsGb')
|
|
|
|
self.assertEqual(self.client.get_address('Bitcoin', [0, -1]), '1JVq66pzRBvqaBRFeU9SPVvg3er4ZDgoMs')
|
|
|
|
self.assertEqual(self.client.get_address('Bitcoin', [-9, 0]), '1F4YdQdL9ZQwvcNTuy5mjyQxXkyCfMcP2P')
|
|
|
|
self.assertEqual(self.client.get_address('Bitcoin', [0, 9999999]), '1GS8X3yc7ntzwGw9vXwj9wqmBWZkTFewBV')
|
2013-01-17 12:37:48 +00:00
|
|
|
|
2013-09-13 03:27:21 +00:00
|
|
|
def test_ltc(self):
|
2014-01-12 15:16:07 +00:00
|
|
|
self.client.load_device_by_mnemonic(mnemonic=self.mnemonic1,
|
|
|
|
pin='',
|
|
|
|
passphrase_protection=False,
|
|
|
|
label='test',
|
|
|
|
language='english')
|
2013-01-17 12:37:48 +00:00
|
|
|
|
2014-01-12 15:16:07 +00:00
|
|
|
self.assertEqual(self.client.get_address('Litecoin', []), 'LYtGrdDeqYUQnTkr5sHT2DKZLG7Hqg7HTK')
|
|
|
|
self.assertEqual(self.client.get_address('Litecoin', [1]), 'LKRGNecThFP3Q6c5fosLVA53Z2hUDb1qnE')
|
|
|
|
self.assertEqual(self.client.get_address('Litecoin', [0, -1]), 'LcinMK8pVrAtpz7Qpc8jfWzSFsDLgLYfG6')
|
|
|
|
self.assertEqual(self.client.get_address('Litecoin', [-9, 0]), 'LZHVtcwAEDf1BR4d67551zUijyLUpDF9EX')
|
|
|
|
self.assertEqual(self.client.get_address('Litecoin', [0, 9999999]), 'Laf5nGHSCT94C5dK6fw2RxuXPiw2ZuRR9S')
|
2013-01-17 12:37:48 +00:00
|
|
|
|
2013-09-13 03:27:21 +00:00
|
|
|
def test_tbtc(self):
|
2014-01-12 15:16:07 +00:00
|
|
|
self.client.load_device_by_mnemonic(mnemonic=self.mnemonic1,
|
|
|
|
pin='',
|
|
|
|
passphrase_protection=False,
|
|
|
|
label='test',
|
|
|
|
language='english')
|
2013-01-17 12:37:48 +00:00
|
|
|
|
2014-01-12 15:16:07 +00:00
|
|
|
self.assertEqual(self.client.get_address('Testnet', [111, 42]), 'moN6aN6NP1KWgnPSqzrrRPvx2x1UtZJssa')
|
2013-09-13 03:27:21 +00:00
|
|
|
|
2013-01-17 12:37:48 +00:00
|
|
|
if __name__ == '__main__':
|
2013-09-13 03:27:21 +00:00
|
|
|
unittest.main()
|