cfg.py 7.4 KB

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