cfg.py 6.8 KB

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