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

ledger hw1 plugin unusable with current git head #1605

Closed
ulrichard opened this issue Jan 4, 2016 · 15 comments
Closed

ledger hw1 plugin unusable with current git head #1605

ulrichard opened this issue Jan 4, 2016 · 15 comments

Comments

@ulrichard
Copy link
Contributor

I didn't test the hw1 for a while, but in the current git head it is unusable.

First It complained about missing QMessageBox, so I added the following line:
from electrum_gui.qt.util import *

If I then try to open the hw1 wallet without the dongle plugged in, I get a message box with the following:
Exception: Exception : No dongle found
And it doesn't open the wallet for viewing.

If I then try to open the hw1 wallet wit the dongle plugged in, I get a message box with the following:
Exception: Could not connect to your Ledger wallet. Please verify access permissions, PIN, or unplug the dongle and plug it again
And it still doesn't open the wallet for viewing.

@ecdsa
Copy link
Member

ecdsa commented Jan 4, 2016

I just tried with a fresh ledger; I get this errror: Invalid status 6d00
@btchip any idea what that message means?

@btchip
Copy link
Contributor

btchip commented Jan 5, 2016

this error is pretty generic, it basically means that the chip is not in
the right state to process this command. I'd need the command logs to
understand what's happening (you can get it by setting DEBUG to True in the
plugin) and I'll take a look at git head as soon as I can (which probably
means in a few days right now)
On Jan 4, 2016 10:31 PM, "ThomasV" notifications@github.com wrote:

I just tried with a fresh ledger; I get this errror: Invalid status 6d00
@btchip https://github.com/btchip any idea what that message means?


Reply to this email directly or view it on GitHub
#1605 (comment).

@ecdsa
Copy link
Member

ecdsa commented Jan 5, 2016

@btchip : FYI, that was one of the new ledgers you sent me lately
(the previous one was too old and I could not update its firmware).
the ledger was fresh and uninitialized.

@kyuupichan
Copy link
Contributor

I've got HEAD to a state where you can create a new wallet from an already-setup ledger.
Untangling the GUI from the core logic will take some time; I will be trying to narrow the differences with it and the Trezor / KeepKey code.

@btchip
Copy link
Contributor

btchip commented Jan 11, 2016

I should also have some simplified code coming up soon

@ulrichard
Copy link
Contributor Author

It's a lot better now. But there's a problem left.
After entering the TAN for a tx, I get this:

File "/home/richi/sourcecode/electrum/gui/qt/util.py", line 226, in run
self.result = self.task()
File "/home/richi/sourcecode/electrum/gui/qt/main_window.py", line 1268, in sign_thread
self.wallet.sign_transaction(tx, password)
File "/home/richi/sourcecode/electrum/plugins/ledger/ledger.py", line 281, in sign_transaction
self.give_error(e, True)
File "/home/richi/sourcecode/electrum/plugins/ledger/ledger.py", line 57, in give_error
raise Exception(message)
Exception: global name 'client' is not defined

@ulrichard
Copy link
Contributor Author

It's also strange that it generates transactions with 4 or 5 outputs when the ledger supports only 2.
I can get around this by entering ! . Then I get to the above problem.

@kyuupichan
Copy link
Contributor

ulrichard: Ledger only supports <= 2-output txs? Are you using the privacy coin chooser?

@ulrichard
Copy link
Contributor Author

yes that was with the privacy coin chooser

@ulrichard
Copy link
Contributor Author

with the current git head I get this when trying to sign a tx:

Traceback (most recent call last):
File "/home/richi/sourcecode/electrum/gui/qt/util.py", line 550, in run
result = task.task()
File "/home/richi/sourcecode/electrum/plugins/ledger/ledger.py", line 194, in sign_transaction
for txinput in tx.inputs:
TypeError: 'instancemethod' object is not iterable

@ecdsa
Copy link
Member

ecdsa commented Jan 27, 2016

@ulrichard that should fix it: 78e9a84

@ulrichard
Copy link
Contributor Author

Now the problem is somewhere else:

Traceback (most recent call last):
File "/home/richi/sourcecode/electrum/gui/qt/util.py", line 550, in run
result = task.task()
File "/home/richi/sourcecode/electrum/plugins/ledger/ledger.py", line 282, in sign_transaction
self.give_error(e, True)
File "/home/richi/sourcecode/electrum/plugins/ledger/ledger.py", line 58, in give_error
raise Exception(message)
Exception: global name 'client' is not defined

@ecdsa
Copy link
Member

ecdsa commented Jan 27, 2016

@ulrichard maybe, line 269, replace client by self.client..
sorry I cannot test
@btchip please help

@btchip
Copy link
Contributor

btchip commented Jan 27, 2016

what's the status of @kyuupichan code ? I don't really have time to test
right now.
On Jan 27, 2016 08:12, "ThomasV" notifications@github.com wrote:

@ulrichard https://github.com/ulrichard maybe, line 269, replace client
by self.client..
sorry I cannot test
@btchip https://github.com/btchip please help


Reply to this email directly or view it on GitHub
#1605 (comment).

@ulrichard
Copy link
Contributor Author

Yes, it was a one liner
#1648

Toporin pushed a commit to Toporin/electrum-satochip that referenced this issue Sep 25, 2019
* Update Chaquopy pycryptodomex hashes

* Add Romanian plural formula

* Take default cashaddr format setting from back end

* Simplify main activity fragment tracking (closes spesmilo#1576)

* Add another null check for TextView.getLayout (closes spesmilo#1592)

* Fix intent handler so URIs are never processed multiple times

* Factor out base class for all dialogs which work on a background thread, and ensure multiple threads are never created (closes spesmilo#1575)

* Add uncapitalized string

* Migrate to AndroidX using IDE

* Tidy up after migration

* Move `py` variable from Daemon.kt to App.kt:

On startup, if ACRA attempts to resend a crash report which previously failed, it accesses `py` to get the Python version number. But this also initializes all the other global variables in the same file, which caused the following exception:

java.lang.IllegalStateException: Cannot invoke setValue on a background thread
        at androidx.lifecycle.LiveData.assertMainThread(LiveData.java:443)
        at androidx.lifecycle.LiveData.setValue(LiveData.java:286)
        at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:33)
        at org.electroncash.electroncash3.DaemonKt.<clinit>(Daemon.kt:23)
        at org.electroncash.electroncash3.DaemonKt.getPy(Unknown Source:0) 
        at org.electroncash.electroncash3.CrashKt$reportToJson$4.invoke(Crash.kt:102)
        at org.electroncash.electroncash3.CrashKt$reportToJson$4.invoke(Unknown Source:0)
        at org.electroncash.electroncash3.CrashKt.putJson(Crash.kt:116)
        at org.electroncash.electroncash3.CrashKt.reportToJson(Crash.kt:101)
        at org.electroncash.electroncash3.CrashhubSender.convertToString(Crash.kt:62)
        at org.acra.sender.HttpSender.send(HttpSender.java:127)
        at org.acra.sender.ReportDistributor.sendCrashReport(ReportDistributor.java:111)
        at org.acra.sender.ReportDistributor.distribute(ReportDistributor.java:76)
        at org.acra.sender.SenderService.onHandleWork(SenderService.java:84)
        at androidx.core.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:392)
        at androidx.core.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:383)
        at android.os.AsyncTask$2.call(AsyncTask.java:333)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764) 

* Fix Enter key repeating if ACTION_UP is lost during a rotation

* Update to androidx.fragment and androidx.appcompat version 1.1.0 (closes spesmilo#1091)

* Implement AlertDialogFragment.createView (spesmilo#1091)

* Access synthetic properties on fragment rather than dialog  /  Remove dialog parameter from onShowDialog and onFirstShowDialog

* Work around toast bug in Android 7.1 (closes spesmilo#1528)

* Fix warning
Toporin pushed a commit to Toporin/electrum-satochip that referenced this issue Feb 16, 2021
* Update Chaquopy pycryptodomex hashes

* Add Romanian plural formula

* Take default cashaddr format setting from back end

* Simplify main activity fragment tracking (closes spesmilo#1576)

* Add another null check for TextView.getLayout (closes spesmilo#1592)

* Fix intent handler so URIs are never processed multiple times

* Factor out base class for all dialogs which work on a background thread, and ensure multiple threads are never created (closes spesmilo#1575)

* Add uncapitalized string

* Migrate to AndroidX using IDE

* Tidy up after migration

* Move `py` variable from Daemon.kt to App.kt:

On startup, if ACRA attempts to resend a crash report which previously failed, it accesses `py` to get the Python version number. But this also initializes all the other global variables in the same file, which caused the following exception:

java.lang.IllegalStateException: Cannot invoke setValue on a background thread
        at androidx.lifecycle.LiveData.assertMainThread(LiveData.java:443)
        at androidx.lifecycle.LiveData.setValue(LiveData.java:286)
        at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:33)
        at org.electroncash.electroncash3.DaemonKt.<clinit>(Daemon.kt:23)
        at org.electroncash.electroncash3.DaemonKt.getPy(Unknown Source:0) 
        at org.electroncash.electroncash3.CrashKt$reportToJson$4.invoke(Crash.kt:102)
        at org.electroncash.electroncash3.CrashKt$reportToJson$4.invoke(Unknown Source:0)
        at org.electroncash.electroncash3.CrashKt.putJson(Crash.kt:116)
        at org.electroncash.electroncash3.CrashKt.reportToJson(Crash.kt:101)
        at org.electroncash.electroncash3.CrashhubSender.convertToString(Crash.kt:62)
        at org.acra.sender.HttpSender.send(HttpSender.java:127)
        at org.acra.sender.ReportDistributor.sendCrashReport(ReportDistributor.java:111)
        at org.acra.sender.ReportDistributor.distribute(ReportDistributor.java:76)
        at org.acra.sender.SenderService.onHandleWork(SenderService.java:84)
        at androidx.core.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:392)
        at androidx.core.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:383)
        at android.os.AsyncTask$2.call(AsyncTask.java:333)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764) 

* Fix Enter key repeating if ACTION_UP is lost during a rotation

* Update to androidx.fragment and androidx.appcompat version 1.1.0 (closes spesmilo#1091)

* Implement AlertDialogFragment.createView (spesmilo#1091)

* Access synthetic properties on fragment rather than dialog  /  Remove dialog parameter from onShowDialog and onFirstShowDialog

* Work around toast bug in Android 7.1 (closes spesmilo#1528)

* Fix warning
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

4 participants