wownero-python/tests/test_seed.py

99 lines
5.2 KiB
Python
Raw Normal View History

Squashed commit of the following: commit 091aa668e194489e3a45e418941ea922c09f7024 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 09:32:50 2018 -0800 removing extraneous import commit 47d2dbcf4e20a4cbba1bb77caa39e8005db00042 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 00:18:19 2018 -0800 matching the version to emesik master and fixing the method name commit 63b5f5fae3a3125b36a6ed18f3f7e47e54cd1d1d Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:37 2018 -0800 adding unit file for seed class commit 515ccfe18663d6f52810d59ccdd9ab51e2be7d58 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:17 2018 -0800 updating init files commit 6e0803661f08694a5a81a83a7fbeede6e18f741c Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:37:46 2018 -0800 updating init from assert to raise, set gte operator on checks commit e066039bf8ccf5128987e6d291864f3a9d61df28 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 18:42:30 2018 -0800 move get_checksum outside of class and always return seed with checksum commit 1b0cb8adc6945d777abba18acfcaf8d3b6f4be42 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 17:14:46 2018 -0800 removing extraneous seed_ prefixes from class vars and change class param to commit 9b60a34da554696f3cfbfd7cb3f0780dfc32bc55 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:52:12 2018 -0800 move generate_hex function outside of class commit 162036cb38ff5a90cf515fd951d70299117866aa Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:49:46 2018 -0800 adding string input to class constructor and determine validity commit 30f04ade1819b152fd600eff0b7364d9bd7aaab4 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:59:19 2018 -0800 adding commit hashes and revamping comments commit c46029fbc9bf74bf64231a1d4c4c6613be08bf00 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:18:07 2018 -0800 adding licensing, verb noun functions, checksum val, hex generation commit fa38d8aa1ea3aeb5ba7d03f89f9610a1b9b76e49 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:19 2018 -0800 adding seed class for encoding/decoding mnemonic phrases or hex strings commit d523e51a92c626a435aad64740d2fe04eb2f8b99 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:03 2018 -0800 adding english wordlist for mnemonic seeds commit f6d78a497a0d48b565f1a584b51150a03f9df7d6 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:56:48 2018 -0800 updating monero init file to include wordlists
2018-02-19 17:35:30 +00:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
Squashed commit of the following: commit 091aa668e194489e3a45e418941ea922c09f7024 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 09:32:50 2018 -0800 removing extraneous import commit 47d2dbcf4e20a4cbba1bb77caa39e8005db00042 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 00:18:19 2018 -0800 matching the version to emesik master and fixing the method name commit 63b5f5fae3a3125b36a6ed18f3f7e47e54cd1d1d Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:37 2018 -0800 adding unit file for seed class commit 515ccfe18663d6f52810d59ccdd9ab51e2be7d58 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:17 2018 -0800 updating init files commit 6e0803661f08694a5a81a83a7fbeede6e18f741c Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:37:46 2018 -0800 updating init from assert to raise, set gte operator on checks commit e066039bf8ccf5128987e6d291864f3a9d61df28 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 18:42:30 2018 -0800 move get_checksum outside of class and always return seed with checksum commit 1b0cb8adc6945d777abba18acfcaf8d3b6f4be42 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 17:14:46 2018 -0800 removing extraneous seed_ prefixes from class vars and change class param to commit 9b60a34da554696f3cfbfd7cb3f0780dfc32bc55 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:52:12 2018 -0800 move generate_hex function outside of class commit 162036cb38ff5a90cf515fd951d70299117866aa Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:49:46 2018 -0800 adding string input to class constructor and determine validity commit 30f04ade1819b152fd600eff0b7364d9bd7aaab4 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:59:19 2018 -0800 adding commit hashes and revamping comments commit c46029fbc9bf74bf64231a1d4c4c6613be08bf00 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:18:07 2018 -0800 adding licensing, verb noun functions, checksum val, hex generation commit fa38d8aa1ea3aeb5ba7d03f89f9610a1b9b76e49 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:19 2018 -0800 adding seed class for encoding/decoding mnemonic phrases or hex strings commit d523e51a92c626a435aad64740d2fe04eb2f8b99 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:03 2018 -0800 adding english wordlist for mnemonic seeds commit f6d78a497a0d48b565f1a584b51150a03f9df7d6 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:56:48 2018 -0800 updating monero init file to include wordlists
2018-02-19 17:35:30 +00:00
import unittest
from monero.seed import Seed
Squashed commit of the following: commit 091aa668e194489e3a45e418941ea922c09f7024 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 09:32:50 2018 -0800 removing extraneous import commit 47d2dbcf4e20a4cbba1bb77caa39e8005db00042 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 00:18:19 2018 -0800 matching the version to emesik master and fixing the method name commit 63b5f5fae3a3125b36a6ed18f3f7e47e54cd1d1d Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:37 2018 -0800 adding unit file for seed class commit 515ccfe18663d6f52810d59ccdd9ab51e2be7d58 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:17 2018 -0800 updating init files commit 6e0803661f08694a5a81a83a7fbeede6e18f741c Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:37:46 2018 -0800 updating init from assert to raise, set gte operator on checks commit e066039bf8ccf5128987e6d291864f3a9d61df28 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 18:42:30 2018 -0800 move get_checksum outside of class and always return seed with checksum commit 1b0cb8adc6945d777abba18acfcaf8d3b6f4be42 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 17:14:46 2018 -0800 removing extraneous seed_ prefixes from class vars and change class param to commit 9b60a34da554696f3cfbfd7cb3f0780dfc32bc55 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:52:12 2018 -0800 move generate_hex function outside of class commit 162036cb38ff5a90cf515fd951d70299117866aa Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:49:46 2018 -0800 adding string input to class constructor and determine validity commit 30f04ade1819b152fd600eff0b7364d9bd7aaab4 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:59:19 2018 -0800 adding commit hashes and revamping comments commit c46029fbc9bf74bf64231a1d4c4c6613be08bf00 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:18:07 2018 -0800 adding licensing, verb noun functions, checksum val, hex generation commit fa38d8aa1ea3aeb5ba7d03f89f9610a1b9b76e49 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:19 2018 -0800 adding seed class for encoding/decoding mnemonic phrases or hex strings commit d523e51a92c626a435aad64740d2fe04eb2f8b99 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:03 2018 -0800 adding english wordlist for mnemonic seeds commit f6d78a497a0d48b565f1a584b51150a03f9df7d6 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:56:48 2018 -0800 updating monero init file to include wordlists
2018-02-19 17:35:30 +00:00
class SeedTestCase(unittest.TestCase):
def test_mnemonic_seed(self):
# Known good 25 word seed phrases should construct a class and register valid hex
Squashed commit of the following: commit 091aa668e194489e3a45e418941ea922c09f7024 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 09:32:50 2018 -0800 removing extraneous import commit 47d2dbcf4e20a4cbba1bb77caa39e8005db00042 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 00:18:19 2018 -0800 matching the version to emesik master and fixing the method name commit 63b5f5fae3a3125b36a6ed18f3f7e47e54cd1d1d Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:37 2018 -0800 adding unit file for seed class commit 515ccfe18663d6f52810d59ccdd9ab51e2be7d58 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:17 2018 -0800 updating init files commit 6e0803661f08694a5a81a83a7fbeede6e18f741c Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:37:46 2018 -0800 updating init from assert to raise, set gte operator on checks commit e066039bf8ccf5128987e6d291864f3a9d61df28 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 18:42:30 2018 -0800 move get_checksum outside of class and always return seed with checksum commit 1b0cb8adc6945d777abba18acfcaf8d3b6f4be42 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 17:14:46 2018 -0800 removing extraneous seed_ prefixes from class vars and change class param to commit 9b60a34da554696f3cfbfd7cb3f0780dfc32bc55 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:52:12 2018 -0800 move generate_hex function outside of class commit 162036cb38ff5a90cf515fd951d70299117866aa Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:49:46 2018 -0800 adding string input to class constructor and determine validity commit 30f04ade1819b152fd600eff0b7364d9bd7aaab4 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:59:19 2018 -0800 adding commit hashes and revamping comments commit c46029fbc9bf74bf64231a1d4c4c6613be08bf00 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:18:07 2018 -0800 adding licensing, verb noun functions, checksum val, hex generation commit fa38d8aa1ea3aeb5ba7d03f89f9610a1b9b76e49 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:19 2018 -0800 adding seed class for encoding/decoding mnemonic phrases or hex strings commit d523e51a92c626a435aad64740d2fe04eb2f8b99 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:03 2018 -0800 adding english wordlist for mnemonic seeds commit f6d78a497a0d48b565f1a584b51150a03f9df7d6 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:56:48 2018 -0800 updating monero init file to include wordlists
2018-02-19 17:35:30 +00:00
seed = Seed("wedge going quick racetrack auburn physics lectures light waist axes whipped habitat square awkward together injury niece nugget guarded hive obnoxious waxing faked folding square")
self.assertEqual(seed.hex, "8ffa9f586b86d294d93731765d192765311bddc76a4fa60311f8af36bbf6fb06")
# Known good 24 word seed phrases should construct a class, store phrase, and register valid hex
Squashed commit of the following: commit 091aa668e194489e3a45e418941ea922c09f7024 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 09:32:50 2018 -0800 removing extraneous import commit 47d2dbcf4e20a4cbba1bb77caa39e8005db00042 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 00:18:19 2018 -0800 matching the version to emesik master and fixing the method name commit 63b5f5fae3a3125b36a6ed18f3f7e47e54cd1d1d Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:37 2018 -0800 adding unit file for seed class commit 515ccfe18663d6f52810d59ccdd9ab51e2be7d58 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:17 2018 -0800 updating init files commit 6e0803661f08694a5a81a83a7fbeede6e18f741c Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:37:46 2018 -0800 updating init from assert to raise, set gte operator on checks commit e066039bf8ccf5128987e6d291864f3a9d61df28 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 18:42:30 2018 -0800 move get_checksum outside of class and always return seed with checksum commit 1b0cb8adc6945d777abba18acfcaf8d3b6f4be42 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 17:14:46 2018 -0800 removing extraneous seed_ prefixes from class vars and change class param to commit 9b60a34da554696f3cfbfd7cb3f0780dfc32bc55 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:52:12 2018 -0800 move generate_hex function outside of class commit 162036cb38ff5a90cf515fd951d70299117866aa Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:49:46 2018 -0800 adding string input to class constructor and determine validity commit 30f04ade1819b152fd600eff0b7364d9bd7aaab4 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:59:19 2018 -0800 adding commit hashes and revamping comments commit c46029fbc9bf74bf64231a1d4c4c6613be08bf00 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:18:07 2018 -0800 adding licensing, verb noun functions, checksum val, hex generation commit fa38d8aa1ea3aeb5ba7d03f89f9610a1b9b76e49 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:19 2018 -0800 adding seed class for encoding/decoding mnemonic phrases or hex strings commit d523e51a92c626a435aad64740d2fe04eb2f8b99 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:03 2018 -0800 adding english wordlist for mnemonic seeds commit f6d78a497a0d48b565f1a584b51150a03f9df7d6 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:56:48 2018 -0800 updating monero init file to include wordlists
2018-02-19 17:35:30 +00:00
seed = Seed("wedge going quick racetrack auburn physics lectures light waist axes whipped habitat square awkward together injury niece nugget guarded hive obnoxious waxing faked folding")
self.assertEqual(seed.hex, "8ffa9f586b86d294d93731765d192765311bddc76a4fa60311f8af36bbf6fb06")
# Known good 25 word hexadecimal strings should construct a class, store phrase, and register valid hex
Squashed commit of the following: commit 091aa668e194489e3a45e418941ea922c09f7024 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 09:32:50 2018 -0800 removing extraneous import commit 47d2dbcf4e20a4cbba1bb77caa39e8005db00042 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 00:18:19 2018 -0800 matching the version to emesik master and fixing the method name commit 63b5f5fae3a3125b36a6ed18f3f7e47e54cd1d1d Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:37 2018 -0800 adding unit file for seed class commit 515ccfe18663d6f52810d59ccdd9ab51e2be7d58 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:17 2018 -0800 updating init files commit 6e0803661f08694a5a81a83a7fbeede6e18f741c Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:37:46 2018 -0800 updating init from assert to raise, set gte operator on checks commit e066039bf8ccf5128987e6d291864f3a9d61df28 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 18:42:30 2018 -0800 move get_checksum outside of class and always return seed with checksum commit 1b0cb8adc6945d777abba18acfcaf8d3b6f4be42 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 17:14:46 2018 -0800 removing extraneous seed_ prefixes from class vars and change class param to commit 9b60a34da554696f3cfbfd7cb3f0780dfc32bc55 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:52:12 2018 -0800 move generate_hex function outside of class commit 162036cb38ff5a90cf515fd951d70299117866aa Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:49:46 2018 -0800 adding string input to class constructor and determine validity commit 30f04ade1819b152fd600eff0b7364d9bd7aaab4 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:59:19 2018 -0800 adding commit hashes and revamping comments commit c46029fbc9bf74bf64231a1d4c4c6613be08bf00 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:18:07 2018 -0800 adding licensing, verb noun functions, checksum val, hex generation commit fa38d8aa1ea3aeb5ba7d03f89f9610a1b9b76e49 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:19 2018 -0800 adding seed class for encoding/decoding mnemonic phrases or hex strings commit d523e51a92c626a435aad64740d2fe04eb2f8b99 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:03 2018 -0800 adding english wordlist for mnemonic seeds commit f6d78a497a0d48b565f1a584b51150a03f9df7d6 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:56:48 2018 -0800 updating monero init file to include wordlists
2018-02-19 17:35:30 +00:00
seed = Seed("8ffa9f586b86d294d93731765d192765311bddc76a4fa60311f8af36bbf6fb06")
self.assertEqual(seed.phrase, "wedge going quick racetrack auburn physics lectures light waist axes whipped habitat square awkward together injury niece nugget guarded hive obnoxious waxing faked folding square")
self.assertTrue(len(seed.hex) % 8 == 0)
Squashed commit of the following: commit 091aa668e194489e3a45e418941ea922c09f7024 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 09:32:50 2018 -0800 removing extraneous import commit 47d2dbcf4e20a4cbba1bb77caa39e8005db00042 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 00:18:19 2018 -0800 matching the version to emesik master and fixing the method name commit 63b5f5fae3a3125b36a6ed18f3f7e47e54cd1d1d Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:37 2018 -0800 adding unit file for seed class commit 515ccfe18663d6f52810d59ccdd9ab51e2be7d58 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:17 2018 -0800 updating init files commit 6e0803661f08694a5a81a83a7fbeede6e18f741c Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:37:46 2018 -0800 updating init from assert to raise, set gte operator on checks commit e066039bf8ccf5128987e6d291864f3a9d61df28 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 18:42:30 2018 -0800 move get_checksum outside of class and always return seed with checksum commit 1b0cb8adc6945d777abba18acfcaf8d3b6f4be42 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 17:14:46 2018 -0800 removing extraneous seed_ prefixes from class vars and change class param to commit 9b60a34da554696f3cfbfd7cb3f0780dfc32bc55 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:52:12 2018 -0800 move generate_hex function outside of class commit 162036cb38ff5a90cf515fd951d70299117866aa Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:49:46 2018 -0800 adding string input to class constructor and determine validity commit 30f04ade1819b152fd600eff0b7364d9bd7aaab4 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:59:19 2018 -0800 adding commit hashes and revamping comments commit c46029fbc9bf74bf64231a1d4c4c6613be08bf00 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:18:07 2018 -0800 adding licensing, verb noun functions, checksum val, hex generation commit fa38d8aa1ea3aeb5ba7d03f89f9610a1b9b76e49 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:19 2018 -0800 adding seed class for encoding/decoding mnemonic phrases or hex strings commit d523e51a92c626a435aad64740d2fe04eb2f8b99 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:03 2018 -0800 adding english wordlist for mnemonic seeds commit f6d78a497a0d48b565f1a584b51150a03f9df7d6 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:56:48 2018 -0800 updating monero init file to include wordlists
2018-02-19 17:35:30 +00:00
# Known good 13 word seed phrases should construct a class and register valid hex
Squashed commit of the following: commit 091aa668e194489e3a45e418941ea922c09f7024 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 09:32:50 2018 -0800 removing extraneous import commit 47d2dbcf4e20a4cbba1bb77caa39e8005db00042 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 00:18:19 2018 -0800 matching the version to emesik master and fixing the method name commit 63b5f5fae3a3125b36a6ed18f3f7e47e54cd1d1d Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:37 2018 -0800 adding unit file for seed class commit 515ccfe18663d6f52810d59ccdd9ab51e2be7d58 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:17 2018 -0800 updating init files commit 6e0803661f08694a5a81a83a7fbeede6e18f741c Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:37:46 2018 -0800 updating init from assert to raise, set gte operator on checks commit e066039bf8ccf5128987e6d291864f3a9d61df28 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 18:42:30 2018 -0800 move get_checksum outside of class and always return seed with checksum commit 1b0cb8adc6945d777abba18acfcaf8d3b6f4be42 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 17:14:46 2018 -0800 removing extraneous seed_ prefixes from class vars and change class param to commit 9b60a34da554696f3cfbfd7cb3f0780dfc32bc55 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:52:12 2018 -0800 move generate_hex function outside of class commit 162036cb38ff5a90cf515fd951d70299117866aa Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:49:46 2018 -0800 adding string input to class constructor and determine validity commit 30f04ade1819b152fd600eff0b7364d9bd7aaab4 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:59:19 2018 -0800 adding commit hashes and revamping comments commit c46029fbc9bf74bf64231a1d4c4c6613be08bf00 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:18:07 2018 -0800 adding licensing, verb noun functions, checksum val, hex generation commit fa38d8aa1ea3aeb5ba7d03f89f9610a1b9b76e49 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:19 2018 -0800 adding seed class for encoding/decoding mnemonic phrases or hex strings commit d523e51a92c626a435aad64740d2fe04eb2f8b99 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:03 2018 -0800 adding english wordlist for mnemonic seeds commit f6d78a497a0d48b565f1a584b51150a03f9df7d6 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:56:48 2018 -0800 updating monero init file to include wordlists
2018-02-19 17:35:30 +00:00
seed = Seed("ought knowledge upright innocent eldest nerves gopher fowls below exquisite aces basin fowls")
self.assertEqual(seed.hex, "932d70711acc2d536ca11fcb79e05516")
# Known good 12 word seed phrases should construct a class, store phrase, and register valid hex
Squashed commit of the following: commit 091aa668e194489e3a45e418941ea922c09f7024 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 09:32:50 2018 -0800 removing extraneous import commit 47d2dbcf4e20a4cbba1bb77caa39e8005db00042 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 00:18:19 2018 -0800 matching the version to emesik master and fixing the method name commit 63b5f5fae3a3125b36a6ed18f3f7e47e54cd1d1d Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:37 2018 -0800 adding unit file for seed class commit 515ccfe18663d6f52810d59ccdd9ab51e2be7d58 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:17 2018 -0800 updating init files commit 6e0803661f08694a5a81a83a7fbeede6e18f741c Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:37:46 2018 -0800 updating init from assert to raise, set gte operator on checks commit e066039bf8ccf5128987e6d291864f3a9d61df28 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 18:42:30 2018 -0800 move get_checksum outside of class and always return seed with checksum commit 1b0cb8adc6945d777abba18acfcaf8d3b6f4be42 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 17:14:46 2018 -0800 removing extraneous seed_ prefixes from class vars and change class param to commit 9b60a34da554696f3cfbfd7cb3f0780dfc32bc55 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:52:12 2018 -0800 move generate_hex function outside of class commit 162036cb38ff5a90cf515fd951d70299117866aa Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:49:46 2018 -0800 adding string input to class constructor and determine validity commit 30f04ade1819b152fd600eff0b7364d9bd7aaab4 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:59:19 2018 -0800 adding commit hashes and revamping comments commit c46029fbc9bf74bf64231a1d4c4c6613be08bf00 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:18:07 2018 -0800 adding licensing, verb noun functions, checksum val, hex generation commit fa38d8aa1ea3aeb5ba7d03f89f9610a1b9b76e49 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:19 2018 -0800 adding seed class for encoding/decoding mnemonic phrases or hex strings commit d523e51a92c626a435aad64740d2fe04eb2f8b99 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:03 2018 -0800 adding english wordlist for mnemonic seeds commit f6d78a497a0d48b565f1a584b51150a03f9df7d6 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:56:48 2018 -0800 updating monero init file to include wordlists
2018-02-19 17:35:30 +00:00
seed = Seed("ought knowledge upright innocent eldest nerves gopher fowls below exquisite aces basin")
self.assertEqual(seed.hex, "932d70711acc2d536ca11fcb79e05516")
# Known good 13 word hexadecimal strings should construct a class, store phrase, and register valid hex
Squashed commit of the following: commit 091aa668e194489e3a45e418941ea922c09f7024 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 09:32:50 2018 -0800 removing extraneous import commit 47d2dbcf4e20a4cbba1bb77caa39e8005db00042 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 00:18:19 2018 -0800 matching the version to emesik master and fixing the method name commit 63b5f5fae3a3125b36a6ed18f3f7e47e54cd1d1d Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:37 2018 -0800 adding unit file for seed class commit 515ccfe18663d6f52810d59ccdd9ab51e2be7d58 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:17 2018 -0800 updating init files commit 6e0803661f08694a5a81a83a7fbeede6e18f741c Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:37:46 2018 -0800 updating init from assert to raise, set gte operator on checks commit e066039bf8ccf5128987e6d291864f3a9d61df28 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 18:42:30 2018 -0800 move get_checksum outside of class and always return seed with checksum commit 1b0cb8adc6945d777abba18acfcaf8d3b6f4be42 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 17:14:46 2018 -0800 removing extraneous seed_ prefixes from class vars and change class param to commit 9b60a34da554696f3cfbfd7cb3f0780dfc32bc55 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:52:12 2018 -0800 move generate_hex function outside of class commit 162036cb38ff5a90cf515fd951d70299117866aa Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:49:46 2018 -0800 adding string input to class constructor and determine validity commit 30f04ade1819b152fd600eff0b7364d9bd7aaab4 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:59:19 2018 -0800 adding commit hashes and revamping comments commit c46029fbc9bf74bf64231a1d4c4c6613be08bf00 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:18:07 2018 -0800 adding licensing, verb noun functions, checksum val, hex generation commit fa38d8aa1ea3aeb5ba7d03f89f9610a1b9b76e49 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:19 2018 -0800 adding seed class for encoding/decoding mnemonic phrases or hex strings commit d523e51a92c626a435aad64740d2fe04eb2f8b99 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:03 2018 -0800 adding english wordlist for mnemonic seeds commit f6d78a497a0d48b565f1a584b51150a03f9df7d6 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:56:48 2018 -0800 updating monero init file to include wordlists
2018-02-19 17:35:30 +00:00
seed = Seed("932d70711acc2d536ca11fcb79e05516")
self.assertEqual(seed.phrase, "ought knowledge upright innocent eldest nerves gopher fowls below exquisite aces basin fowls")
self.assertTrue(len(seed.hex) % 8 == 0)
Squashed commit of the following: commit 091aa668e194489e3a45e418941ea922c09f7024 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 09:32:50 2018 -0800 removing extraneous import commit 47d2dbcf4e20a4cbba1bb77caa39e8005db00042 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 00:18:19 2018 -0800 matching the version to emesik master and fixing the method name commit 63b5f5fae3a3125b36a6ed18f3f7e47e54cd1d1d Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:37 2018 -0800 adding unit file for seed class commit 515ccfe18663d6f52810d59ccdd9ab51e2be7d58 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:17 2018 -0800 updating init files commit 6e0803661f08694a5a81a83a7fbeede6e18f741c Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:37:46 2018 -0800 updating init from assert to raise, set gte operator on checks commit e066039bf8ccf5128987e6d291864f3a9d61df28 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 18:42:30 2018 -0800 move get_checksum outside of class and always return seed with checksum commit 1b0cb8adc6945d777abba18acfcaf8d3b6f4be42 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 17:14:46 2018 -0800 removing extraneous seed_ prefixes from class vars and change class param to commit 9b60a34da554696f3cfbfd7cb3f0780dfc32bc55 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:52:12 2018 -0800 move generate_hex function outside of class commit 162036cb38ff5a90cf515fd951d70299117866aa Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:49:46 2018 -0800 adding string input to class constructor and determine validity commit 30f04ade1819b152fd600eff0b7364d9bd7aaab4 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:59:19 2018 -0800 adding commit hashes and revamping comments commit c46029fbc9bf74bf64231a1d4c4c6613be08bf00 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:18:07 2018 -0800 adding licensing, verb noun functions, checksum val, hex generation commit fa38d8aa1ea3aeb5ba7d03f89f9610a1b9b76e49 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:19 2018 -0800 adding seed class for encoding/decoding mnemonic phrases or hex strings commit d523e51a92c626a435aad64740d2fe04eb2f8b99 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:03 2018 -0800 adding english wordlist for mnemonic seeds commit f6d78a497a0d48b565f1a584b51150a03f9df7d6 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:56:48 2018 -0800 updating monero init file to include wordlists
2018-02-19 17:35:30 +00:00
# Generated seed phrases should be 25 words, register valid hex
Squashed commit of the following: commit 091aa668e194489e3a45e418941ea922c09f7024 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 09:32:50 2018 -0800 removing extraneous import commit 47d2dbcf4e20a4cbba1bb77caa39e8005db00042 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 00:18:19 2018 -0800 matching the version to emesik master and fixing the method name commit 63b5f5fae3a3125b36a6ed18f3f7e47e54cd1d1d Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:37 2018 -0800 adding unit file for seed class commit 515ccfe18663d6f52810d59ccdd9ab51e2be7d58 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:17 2018 -0800 updating init files commit 6e0803661f08694a5a81a83a7fbeede6e18f741c Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:37:46 2018 -0800 updating init from assert to raise, set gte operator on checks commit e066039bf8ccf5128987e6d291864f3a9d61df28 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 18:42:30 2018 -0800 move get_checksum outside of class and always return seed with checksum commit 1b0cb8adc6945d777abba18acfcaf8d3b6f4be42 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 17:14:46 2018 -0800 removing extraneous seed_ prefixes from class vars and change class param to commit 9b60a34da554696f3cfbfd7cb3f0780dfc32bc55 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:52:12 2018 -0800 move generate_hex function outside of class commit 162036cb38ff5a90cf515fd951d70299117866aa Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:49:46 2018 -0800 adding string input to class constructor and determine validity commit 30f04ade1819b152fd600eff0b7364d9bd7aaab4 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:59:19 2018 -0800 adding commit hashes and revamping comments commit c46029fbc9bf74bf64231a1d4c4c6613be08bf00 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:18:07 2018 -0800 adding licensing, verb noun functions, checksum val, hex generation commit fa38d8aa1ea3aeb5ba7d03f89f9610a1b9b76e49 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:19 2018 -0800 adding seed class for encoding/decoding mnemonic phrases or hex strings commit d523e51a92c626a435aad64740d2fe04eb2f8b99 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:03 2018 -0800 adding english wordlist for mnemonic seeds commit f6d78a497a0d48b565f1a584b51150a03f9df7d6 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:56:48 2018 -0800 updating monero init file to include wordlists
2018-02-19 17:35:30 +00:00
seed = Seed()
seed_split = seed.phrase.split(" ")
self.assertTrue(len(seed_split) == 25)
self.assertTrue(len(seed.hex) % 8 == 0)
# Invalid phrases should not be allowed
with self.assertRaises(ValueError) as ts:
Seed("oh damn you thought fool")
self.assertEqual(ts.expected, ValueError)
with self.assertRaises(ValueError) as ts:
Seed("Thi5isMyS3cr3tPa55w0rd")
self.assertEqual(ts.expected, ValueError)
with self.assertRaises(ValueError) as ts:
Seed(" ")
self.assertEqual(ts.expected, ValueError)
with self.assertRaises(ValueError) as ts:
Seed("\\x008")
self.assertEqual(ts.expected, ValueError)
def test_keys(self):
seed = Seed("adjust mugged vaults atlas nasty mews damp toenail suddenly toxic possible "\
"framed succeed fuzzy return demonstrate nucleus album noises peculiar virtual "\
"rowboat inorganic jester fuzzy")
self.assertFalse(seed.is_mymonero())
self.assertEqual(
seed.secret_spend_key(),
'482700617ba810f94035d7f4d7ccc1a29878e165b4867872b705204c85406906')
self.assertEqual(
seed.secret_view_key(),
'09ed72c713d3e9e19bef2f5204cf85f6cb25de7842aa0722abeb12697f171903')
self.assertEqual(
seed.public_spend_key(),
'4ee576f52b9c6a824a3d5c2832d117177d2bb9992507c2c78788bb8dbaf4b640')
self.assertEqual(
seed.public_view_key(),
'e1ef99d66312ec0b16b17c66c591ab59594e21621588b63b62fa69fe615a768e')
self.assertEqual(
seed.public_address(),
'44cWztNFdAqNnycvZbUoj44vsbAEmKnx9aNgkjHdjtMsBrSeKiY8J4s2raH7EMawA2Fwo9utaRTV7Aw8EcTMNMxhH4YtKdH')
self.assertEqual(
seed.public_address(net='stagenet'),
'54pZ5jHDGmwNnycvZbUoj44vsbAEmKnx9aNgkjHdjtMsBrSeKiY8J4s2raH7EMawA2Fwo9utaRTV7Aw8EcTMNMxhH6cuARW')
seed = Seed("dwelt idols lopped blender haggled rabbits piloted value swagger taunts toolbox upgrade swagger")
self.assertTrue(seed.is_mymonero())
2018-05-26 16:05:47 +00:00
# check if the same seed without checksum matches the hex
self.assertEqual(seed.hex, Seed(" ".join(seed.phrase.split(" ")[:12])).hex)
# the following fails, #21 addresses that
self.assertEqual(
seed.secret_spend_key(),
'a67505f92004dd6242b64acd16e34ecf788a2d28b6072091e054238d84591403')
self.assertEqual(
seed.secret_view_key(),
'83f652cb370948c8cbcf06839df043aa8c0d0ed36e38b3c827c4c00370af1a0f')
self.assertEqual(
seed.public_address(),
'47dwi1w9it69yZyTBBRD52ctQqw3B2FZx79bCEgVUKGHH2m7MjmaXrjeQfchMMkarG6AF9a36JvBWCyRaqEcUixpKLQRxdj')
Squashed commit of the following: commit 091aa668e194489e3a45e418941ea922c09f7024 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 09:32:50 2018 -0800 removing extraneous import commit 47d2dbcf4e20a4cbba1bb77caa39e8005db00042 Author: lance allen <lrallen03@gmail.com> Date: Mon Feb 19 00:18:19 2018 -0800 matching the version to emesik master and fixing the method name commit 63b5f5fae3a3125b36a6ed18f3f7e47e54cd1d1d Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:37 2018 -0800 adding unit file for seed class commit 515ccfe18663d6f52810d59ccdd9ab51e2be7d58 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:38:17 2018 -0800 updating init files commit 6e0803661f08694a5a81a83a7fbeede6e18f741c Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 22:37:46 2018 -0800 updating init from assert to raise, set gte operator on checks commit e066039bf8ccf5128987e6d291864f3a9d61df28 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 18:42:30 2018 -0800 move get_checksum outside of class and always return seed with checksum commit 1b0cb8adc6945d777abba18acfcaf8d3b6f4be42 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 17:14:46 2018 -0800 removing extraneous seed_ prefixes from class vars and change class param to commit 9b60a34da554696f3cfbfd7cb3f0780dfc32bc55 Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:52:12 2018 -0800 move generate_hex function outside of class commit 162036cb38ff5a90cf515fd951d70299117866aa Author: lance allen <lrallen03@gmail.com> Date: Sun Feb 18 13:49:46 2018 -0800 adding string input to class constructor and determine validity commit 30f04ade1819b152fd600eff0b7364d9bd7aaab4 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:59:19 2018 -0800 adding commit hashes and revamping comments commit c46029fbc9bf74bf64231a1d4c4c6613be08bf00 Author: lalanza808 <lrallen03@gmail.com> Date: Sat Feb 17 23:18:07 2018 -0800 adding licensing, verb noun functions, checksum val, hex generation commit fa38d8aa1ea3aeb5ba7d03f89f9610a1b9b76e49 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:19 2018 -0800 adding seed class for encoding/decoding mnemonic phrases or hex strings commit d523e51a92c626a435aad64740d2fe04eb2f8b99 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:57:03 2018 -0800 adding english wordlist for mnemonic seeds commit f6d78a497a0d48b565f1a584b51150a03f9df7d6 Author: lance allen <lrallen03@gmail.com> Date: Sat Feb 17 16:56:48 2018 -0800 updating monero init file to include wordlists
2018-02-19 17:35:30 +00:00
if __name__ == "__main__":
unittest.main()