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

Error when adding account from Ledger Nano X #46

Open
craig-openlaw opened this issue Jul 2, 2024 · 1 comment
Open

Error when adding account from Ledger Nano X #46

craig-openlaw opened this issue Jul 2, 2024 · 1 comment
Labels

Comments

@craig-openlaw
Copy link

Environment information

  • ape and plugin versions:
$ ape --version
0.8.5

$ ape plugins list
Installed Plugins
  ledger    0.8.1.dev1+g7725b01
  safe      0.8.2
  tokens    0.8.0
  • Python Version: 3.12.3
  • OS: Ubuntu 24.04

What went wrong?

When trying to add an account from a Leger Nano X it fails with the error: "AttributeError: module 'hid' has no attribute 'device'. Did you mean: 'Device'?"

Please include information like:

I ran: ape ledger add ledger

The ape program failed with this trace:

$ ape ledger add ledger
Traceback (most recent call last):
  File "/home/c/.python/bin/ape", line 33, in <module>
    sys.exit(load_entry_point('eth-ape==0.8.5', 'console_scripts', 'ape')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/ape/_cli.py", line 104, in invoke
    return super().invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/ape_ledger-0.8.1.dev1+g7725b01-py3.12.egg/ape_ledger/_cli.py", line 74, in add
    address, account_hd_path = _select_account(hd_path)
                               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/ape_ledger-0.8.1.dev1+g7725b01-py3.12.egg/ape_ledger/_cli.py", line 23, in _select_account
    return choices.get_user_selected_account()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/ape_ledger-0.8.1.dev1+g7725b01-py3.12.egg/ape_ledger/choices.py", line 67, in get_user_selected_account
    self._load_choices()
  File "/home/c/.python/lib/python3.12/site-packages/ape_ledger-0.8.1.dev1+g7725b01-py3.12.egg/ape_ledger/choices.py", line 98, in _load_choices
    self.choices = [self._get_address(i) for i in index_range]
                    ^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/ape_ledger-0.8.1.dev1+g7725b01-py3.12.egg/ape_ledger/choices.py", line 103, in _get_address
    return device.get_address()
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/ape_ledger-0.8.1.dev1+g7725b01-py3.12.egg/ape_ledger/client.py", line 56, in get_address
    return get_account_by_path(self._account, dongle=self.dongle).address
                                                     ^^^^^^^^^^^
  File "/usr/lib/python3.12/functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/ape_ledger-0.8.1.dev1+g7725b01-py3.12.egg/ape_ledger/client.py", line 46, in dongle
    device = get_dongle(debug=debug)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/ape_ledger-0.8.1.dev1+g7725b01-py3.12.egg/ape_ledger/client.py", line 28, in get_dongle
    return getDongle(debug=debug)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/c/.python/lib/python3.12/site-packages/ledgerblue/comm.py", line 360, in getDongle
    dev = hid.device()
          ^^^^^^^^^^
AttributeError: module 'hid' has no attribute 'device'. Did you mean: 'Device'?
Copy link

linear bot commented Jul 2, 2024

@vany365 vany365 added the Bug label Jul 10, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants