Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vulture outputs a lot of dead code #2213

Open
gasull opened this issue Mar 26, 2021 · 1 comment
Open

vulture outputs a lot of dead code #2213

gasull opened this issue Mar 26, 2021 · 1 comment

Comments

@gasull
Copy link

gasull commented Mar 26, 2021

I tried vulture on the root directory of the project:

$ vulture . --min-confidence=100 --exclude=contrib/,electroncash_plugins/,android/,ios/,.tox/
/home/user/workspace/Electron-Cash/electroncash/cashacct.py:1756: unused variable 'out_n' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/coinchooser.py:102: unused variable 'candidate' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/commands.py:954: unused variable 'option_string' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/keystore.py:751: unused variable 'is_p2sh' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/network.py:526: unreachable code after 'return' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/network.py:1219: unsatisfiable 'if' condition (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/network.py:1639: unsatisfiable 'if' condition (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/network.py:1657: unsatisfiable 'if' condition (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/paymentrequest.py:445: unreachable code after 'raise' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/paymentrequest.py:767: unreachable code after 'return' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/qrreaders/__init__.py:39: unsatisfiable 'if' condition (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/rsakey.py:128: unreachable code after 'return' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/simple_config.py:378: unreachable code after 'return' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/tests/test_wallet_vertical.py:51: unused variable 'mock_write' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/tests/test_wallet_vertical.py:70: unused variable 'mock_write' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/tests/test_wallet_vertical.py:89: unused variable 'mock_write' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/tests/test_wallet_vertical.py:108: unused variable 'mock_write' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/tests/test_wallet_vertical.py:127: unused variable 'mock_write' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/verifier.py:71: unused variable 'blkchain' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/wallet.py:1979: unreachable code after 'raise' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/wallet.py:2873: unused variable 'include_change' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash/wallet.py:2947: unused variable 'include_change' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash_gui/qt/__init__.py:995: unused variable 'signum' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash_gui/qt/cashacctqt.py:503: unused variable 'gbtext' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash_gui/qt/cashacctqt.py:616: unused variable 'ign' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash_gui/qt/contact_list.py:99: unused variable 'prior_value' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash_gui/qt/main_window.py:4378: unused variable 'ignored_param' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash_gui/qt/main_window.py:5036: unused variable 'previous' (100% confidence)
/home/user/workspace/Electron-Cash/electroncash_gui/qt/transaction_dialog.py:51: unsatisfiable 'if' condition (100% confidence)
gasull added a commit to gasull/Electron-Cash that referenced this issue Mar 26, 2021
gasull added a commit to gasull/Electron-Cash that referenced this issue Mar 26, 2021
@gasull
Copy link
Author

gasull commented Mar 26, 2021

From the vulture output above:

/home/user/workspace/Electron-Cash/electroncash/keystore.py:751: unused variable 'is_p2sh' (100% confidence)

Then, looking at the code:

def from_seed(seed, passphrase, is_p2sh=None, *, seed_type='', derivation=None) -> KeyStore:
    del is_p2sh  # argument totally ignored.  Legacy API.
[...]

Please help me understand why we are doing this:

P2SH addresses are valid in BCH, why aren't we accepting them?

Don't we need P2SH for multisig wallets?

Did we remove the code from Electrum for P2SH wallets? Why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant