2013-01-17 12:37:48 +00:00
|
|
|
import unittest
|
|
|
|
import common
|
|
|
|
|
2013-09-01 01:38:03 +00:00
|
|
|
# FIXME: This test implements Electrum algorithm only
|
2013-01-17 12:37:48 +00:00
|
|
|
|
|
|
|
class TestAddresses(common.BitkeyTest):
|
2013-09-01 01:38:03 +00:00
|
|
|
def test_address(self):
|
|
|
|
self.bitkey.load_device(
|
2013-04-15 17:57:36 +00:00
|
|
|
seed='beyond neighbor scratch swirl embarrass doll cause also stick softly physical nice',
|
2013-09-01 01:38:03 +00:00
|
|
|
pin='')
|
2013-01-17 12:37:48 +00:00
|
|
|
|
|
|
|
self.assertEqual(self.bitkey.get_address([0, 0]), "1KqYyzL53R8oA1LdYvyv7m6JUryFfGJDpa")
|
|
|
|
self.assertEqual(self.bitkey.get_address([2, 0]), "13MzKU6YjjdyiW3dZJDa5VU4AWGczQsdYD")
|
|
|
|
self.assertEqual(self.bitkey.get_address([3, 0]), "1FQVPnjrbkPWeA8poUoEnX9U3n9DyhAVtv")
|
|
|
|
self.assertEqual(self.bitkey.get_address([9, 0]), "1C9DHmWBpvGcFKXEiWWC3EK3EY5Bj79nze")
|
|
|
|
|
2013-09-01 01:38:03 +00:00
|
|
|
def test_change_address(self):
|
|
|
|
self.bitkey.load_device(
|
2013-04-15 17:57:36 +00:00
|
|
|
seed='beyond neighbor scratch swirl embarrass doll cause also stick softly physical nice',
|
2013-09-01 01:38:03 +00:00
|
|
|
pin='')
|
2013-01-17 12:37:48 +00:00
|
|
|
|
|
|
|
self.assertEqual(self.bitkey.get_address([0, 1]), "17GpAFnkHRjWKePkX4kxHaHy49V8EHTr7i")
|
|
|
|
self.assertEqual(self.bitkey.get_address([2, 1]), "1MVgq4XaMX7PmohkYzFEisH1D7uxTiPbFK")
|
|
|
|
self.assertEqual(self.bitkey.get_address([3, 1]), "1M5NSqrUmmkZqokpHsJd5xm74YG6kjVcz4")
|
|
|
|
self.assertEqual(self.bitkey.get_address([9, 1]), "1BXUkUsc5gGSzYUAEebg5WZWtRGPNW4NQ9")
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|