cfg.py 6.9 KB

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