JoinMarket-Org / joinmarket-clientserver

Bitcoin CoinJoin implementation with incentive structure to convince people to take part
GNU General Public License v3.0
733 stars 179 forks source link

wallet-tool crashes instead of giving an error message when wrong arguments provided #742

Closed jambolo closed 4 years ago

jambolo commented 4 years ago

I was generating a new wallet for 0.8.0 and I got this:

(jmvenv) ~/joinmarket/scripts $ python wallet-tool.py wallet.jmdat generate User data location: /home/node/.joinmarket/ Enter passphrase to decrypt wallet: Would you like to use a two-factor mnemonic recovery phrase? write 'n' if you don't know what this is (y/n): n Not using mnemonic extension Enter new passphrase to encrypt wallet: Reenter new passphrase to encrypt wallet: Input wallet file name (default: wallet.jmdat): bc1.wallet.jmdat Traceback (most recent call last): File "wallet-tool.py", line 6, in jmprint(wallet_tool_main("wallets"), "success") File "/home/node/joinmarket-clientserver-0.8.0/jmclient/jmclient/wallet_utils.py", line 1465, in wallet_tool_main mixdepth=options.mixdepth) File "/home/node/joinmarket-clientserver-0.8.0/jmclient/jmclient/wallet_utils.py", line 670, in wallet_generate_recover cli_do_support_fidelity_bonds, mixdepth=mixdepth) File "/home/node/joinmarket-clientserver-0.8.0/jmclient/jmclient/wallet_utils.py", line 654, in wallet_generate_recover_bip39 entropy_extension=mnemonic_extension) File "/home/node/joinmarket-clientserver-0.8.0/jmclient/jmclient/wallet_utils.py", line 1261, in create_wallet kwargs) File "/home/node/joinmarket-clientserver-0.8.0/jmclient/jmclient/wallet.py", line 1568, in initialize storage, network, max_mixdepth, timestamp, write=False, kwargs) File "/home/node/joinmarket-clientserver-0.8.0/jmclient/jmclient/wallet.py", line 1736, in initialize write=False, kwargs) File "/home/node/joinmarket-clientserver-0.8.0/jmclient/jmclient/wallet.py", line 1821, in initialize timestamp, write=False) File "/home/node/joinmarket-clientserver-0.8.0/jmclient/jmclient/wallet.py", line 404, in initialize assert max_mixdepth >= 0 TypeError: '>=' not supported between instances of 'NoneType' and 'int' (jmvenv) ~/joinmarket/scripts $ python wallet-tool.py --version** JoinMarket 0.8.0

AdamISZ commented 4 years ago

The generate method doesn't take arguments: python wallet-tool.py generate. You add the filename during the prompts.

jambolo commented 4 years ago

Thanks for the solution. Perhaps a quick check of the command line would be preferable to a broken assertion.

AdamISZ commented 4 years ago

Indeed, good point. Do you mind if I rename the issue to refer to that needed improvement, and then we can PR to change it?

jambolo commented 4 years ago

Go for it. Sorry, I don't have the bandwidth right now to contribute.