cfg.py 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. #!/usr/bin/env python3
  2. #
  3. # mmgen = Multi-Mode GENerator, a command-line cryptocurrency wallet
  4. # Copyright (C)2013-2023 The MMGen Project <mmgen@tuta.io>
  5. # Licensed under the GNU General Public License, Version 3:
  6. # https://www.gnu.org/licenses
  7. # Public project repositories:
  8. # https://github.com/mmgen/mmgen
  9. # https://gitlab.com/mmgen/mmgen
  10. """
  11. test.test_py_d.cfg: configuration data for test.py
  12. """
  13. from .common import *
  14. from ..include.common import cfg
  15. cmd_groups_dfl = {
  16. 'misc': ('TestSuiteMisc',{}),
  17. 'opts': ('TestSuiteOpts',{'full_data':True}),
  18. 'cfgfile': ('TestSuiteCfgFile',{'full_data':True}),
  19. 'helpscreens': ('TestSuiteHelp',{'modname':'misc','full_data':True}),
  20. 'main': ('TestSuiteMain',{'full_data':True}),
  21. 'conv': ('TestSuiteWalletConv',{'is3seed':True,'modname':'wallet'}),
  22. 'ref': ('TestSuiteRef',{}),
  23. 'ref3': ('TestSuiteRef3Seed',{'is3seed':True,'modname':'ref_3seed'}),
  24. 'ref3_addr': ('TestSuiteRef3Addr',{'is3seed':True,'modname':'ref_3seed'}),
  25. 'ref_altcoin': ('TestSuiteRefAltcoin',{}),
  26. 'seedsplit': ('TestSuiteSeedSplit',{}),
  27. 'tool': ('TestSuiteTool',{'full_data':True}),
  28. 'input': ('TestSuiteInput',{}),
  29. 'output': ('TestSuiteOutput',{'modname':'misc','full_data':True}),
  30. 'autosign': ('TestSuiteAutosign',{}),
  31. 'regtest': ('TestSuiteRegtest',{}),
  32. # 'chainsplit': ('TestSuiteChainsplit',{}),
  33. 'ethdev': ('TestSuiteEthdev',{}),
  34. 'xmrwallet': ('TestSuiteXMRWallet',{}),
  35. 'xmr_autosign': ('TestSuiteXMRAutosign',{}),
  36. }
  37. cmd_groups_extra = {
  38. 'autosign_btc': ('TestSuiteAutosignBTC',{'modname':'autosign'}),
  39. 'autosign_live': ('TestSuiteAutosignLive',{'modname':'autosign'}),
  40. 'autosign_live_simulate': ('TestSuiteAutosignLiveSimulate',{'modname':'autosign'}),
  41. 'create_ref_tx': ('TestSuiteRefTX',{'modname':'misc','full_data':True}),
  42. }
  43. cfgs = { # addr_idx_lists (except 31,32,33,34) must contain exactly 8 addresses
  44. '1': { 'wpasswd': 'Dorian-α',
  45. 'kapasswd': 'Grok the blockchain',
  46. 'addr_idx_list': '12,99,5-10,5,12',
  47. 'dep_generators': {
  48. pwfile: 'walletgen',
  49. 'mmdat': 'walletgen',
  50. 'addrs': 'addrgen',
  51. 'rawtx': 'txcreate',
  52. 'txbump': 'txbump',
  53. 'sigtx': 'txsign',
  54. 'mmwords': 'export_mnemonic',
  55. 'mmseed': 'export_seed',
  56. 'mmhex': 'export_hex',
  57. 'mmincog': 'export_incog',
  58. 'mmincox': 'export_incog_hex',
  59. hincog_fn: 'export_incog_hidden',
  60. incog_id_fn: 'export_incog_hidden',
  61. 'akeys.mmenc': 'keyaddrgen'
  62. },
  63. },
  64. '2': { 'wpasswd': 'Hodling away',
  65. 'addr_idx_list': '37,45,3-6,22-23',
  66. 'seed_len': 128,
  67. 'dep_generators': {
  68. 'mmdat': 'walletgen2',
  69. 'addrs': 'addrgen2',
  70. 'rawtx': 'txcreate2',
  71. 'sigtx': 'txsign2',
  72. 'mmwords': 'export_mnemonic2',
  73. },
  74. },
  75. '3': { 'wpasswd': 'Major miner',
  76. 'addr_idx_list': '73,54,1022-1023,2-5',
  77. 'dep_generators': {
  78. 'mmdat': 'walletgen3',
  79. 'addrs': 'addrgen3',
  80. 'rawtx': 'txcreate3',
  81. 'sigtx': 'txsign3'
  82. },
  83. },
  84. '4': { 'wpasswd': 'Hashrate good',
  85. 'addr_idx_list': '63,1004,542-544,7-9',
  86. 'seed_len': 192,
  87. 'dep_generators': {
  88. 'mmdat': 'walletgen4',
  89. 'mmbrain': 'walletgen4',
  90. 'addrs': 'addrgen4',
  91. 'rawtx': 'txcreate4',
  92. 'sigtx': 'txsign4',
  93. 'txdo': 'txdo4',
  94. },
  95. 'bw_filename': 'brainwallet.mmbrain',
  96. 'bw_params': '192,1',
  97. },
  98. '5': { 'wpasswd': 'My changed password-α',
  99. 'hash_preset': '2',
  100. 'dep_generators': {
  101. 'mmdat': 'passchg',
  102. pwfile: 'passchg',
  103. },
  104. },
  105. '6': { 'seed_len': 128,
  106. 'seed_id': 'FE3C6545',
  107. 'ref_bw_seed_id': '33F10310',
  108. 'wpasswd': 'reference password',
  109. 'kapasswd': '',
  110. 'dep_generators': {
  111. 'mmdat': 'ref_walletgen_brain_1',
  112. pwfile: 'ref_walletgen_brain_1',
  113. 'addrs': 'refaddrgen_1',
  114. 'akeys.mmenc': 'refkeyaddrgen_1'
  115. },
  116. },
  117. '7': { 'seed_len': 192,
  118. 'seed_id': '1378FC64',
  119. 'ref_bw_seed_id': 'CE918388',
  120. 'wpasswd': 'reference password',
  121. 'kapasswd': '',
  122. 'dep_generators': {
  123. 'mmdat': 'ref_walletgen_brain_2',
  124. pwfile: 'ref_walletgen_brain_2',
  125. 'addrs': 'refaddrgen_2',
  126. 'akeys.mmenc': 'refkeyaddrgen_2'
  127. },
  128. },
  129. '8': { 'seed_len': 256,
  130. 'seed_id': '98831F3A',
  131. 'ref_bw_seed_id': 'B48CD7FC',
  132. 'wpasswd': 'reference password',
  133. 'kapasswd': '',
  134. 'dep_generators': {
  135. 'mmdat': 'ref_walletgen_brain_3',
  136. pwfile: 'ref_walletgen_brain_3',
  137. 'addrs': 'refaddrgen_3',
  138. 'akeys.mmenc': 'refkeyaddrgen_3'
  139. },
  140. },
  141. '9': { 'tool_enc_infn': 'tool_encrypt.in',
  142. 'dep_generators': {
  143. 'tool_encrypt.in': 'tool_encrypt',
  144. 'tool_encrypt.in.mmenc': 'tool_encrypt',
  145. },
  146. },
  147. '11': {},
  148. '12': {},
  149. '13': {},
  150. '14': { 'kapasswd': 'Maxwell',
  151. 'wpasswd': 'The Halving',
  152. 'addr_idx_list': '61,998,502-504,7-9',
  153. 'seed_len': 256,
  154. 'dep_generators': {
  155. 'mmdat': 'walletgen14',
  156. 'addrs': 'addrgen14',
  157. 'akeys.mmenc': 'keyaddrgen14',
  158. },
  159. },
  160. '15': { 'wpasswd': 'Dorian-α',
  161. 'kapasswd': 'Grok the blockchain',
  162. 'addr_idx_list': '12,99,5-10,5,12',
  163. 'dep_generators': {
  164. pwfile: 'walletgen_dfl_wallet',
  165. 'addrs': 'addrgen_dfl_wallet',
  166. 'rawtx': 'txcreate_dfl_wallet',
  167. 'sigtx': 'txsign_dfl_wallet',
  168. 'mmseed': 'export_seed_dfl_wallet',
  169. 'del_dw_run': 'delete_dfl_wallet',
  170. },
  171. },
  172. '16': { 'wpasswd': 'My changed password',
  173. 'hash_preset': '2',
  174. 'dep_generators': {
  175. pwfile: 'passchg_dfl_wallet',
  176. },
  177. },
  178. '17': {},
  179. '18': {},
  180. '19': { 'wpasswd':'abc' },
  181. '20': { 'wpasswd': 'Vsize it',
  182. 'addr_idx_list': '1-8',
  183. 'seed_len': 256,
  184. 'dep_generators': {
  185. 'mmdat': 'walletgen5',
  186. 'addrs': 'addrgen5',
  187. 'rawtx': 'txcreate5',
  188. 'sigtx': 'txsign5',
  189. },
  190. },
  191. '21': { 'wpasswd': 'Vsize it',
  192. 'addr_idx_list': '1-8',
  193. 'seed_len': 256,
  194. 'dep_generators': {
  195. 'mmdat': 'walletgen6',
  196. 'addrs': 'addrgen6',
  197. 'rawtx': 'txcreate6',
  198. 'sigtx': 'txsign6',
  199. },
  200. },
  201. '22': {},
  202. '23': {},
  203. '26': {},
  204. '27': {},
  205. '28': {},
  206. '29': {}, # xmrwallet
  207. '31': {},
  208. '32': {},
  209. '33': {},
  210. '34': {},
  211. '39': {},
  212. '40': {},
  213. '41': {},
  214. '99': {}, # dummy
  215. }
  216. def fixup_cfgs():
  217. for src,target in (
  218. ('6','11'),
  219. ('7','12'),
  220. ('8','13'),
  221. ('6','26'),
  222. ('7','27'),
  223. ('8','28')
  224. ):
  225. cfgs[target].update(cfgs[src])
  226. cfgs[target]['tmpdir'] = os.path.join('test','tmp',target)
  227. for k in cfgs:
  228. cfgs[k]['segwit'] = randbool() if cfg.segwit_random else bool(cfg.segwit or cfg.bech32)
  229. if cfg.debug_utf8:
  230. for k in cfgs:
  231. cfgs[k]['tmpdir'] += '-α'