Electron-cash: Cannot send BCH from ElectronCash using Trezor: 'TxInputType' object has no attribute 'amount'

Created on 4 Aug 2017  路  19Comments  路  Source: Electron-Cash/Electron-Cash

Ok, so I had no problems at all creating a new wallet on my Trezor using ElectronCash. I claimed my Trezor BCH directly to my ElectronCash wallet. No problems so far.

Now I would like to send my BCH out to exchange. I start ElectronCash and register my Trezor, no problem, balance is correct. Last TX has 22 confirmations. All looks good.

When I create a send TX I cannot send or sign the TX. I get the following error dialog popup:

'TxInputType' object has no attribute 'amount'

I am definitely filling out the amount and fee correctly. Everything is properly filled out.

Has anybody else had issues sending BCH from EC on Trezor?

SM

All 19 comments

are you on latest 2.9.2 version?

Fails with latest 2.9.2 and latest "cash" branch too.

Yes, I'm using 2.9.2.. in 2.9.0 the send would fail with this different error:

sign_tx() got an unexpected keyword argument 'locktime'

is there some locktime thing you're doing?

No, it just doesn't work.

@jhoenicke any idea?

@anduck or @spottedmarley, can you run with "-v" flag and post the output during a signing fail?

I think I've seen this one myself during testing, but that was quite a while ago, even before the 2.9.0-release.

Are you guys on most recent python-trezor? Your trezor firmware is 1.5.1, I assume.

from kyuupi:

You need to remove the locktime= from the trezor plugin
electrum keeps adding it back and breaking stuff. line 242 of plugin.py i think

Removed locktime=, can sign now -- but it won't return to Electrum as signed. Using 2.9.0.

sign_tx() got an unexpected keyword argument 'locktime' when using 2.9.2.

'TxInputType' object has no attribute 'amount' when using master/cash.

@molecular Here is the output when I attempt to sign:

(also, I am using python-trezor 0.6.10-1)

[profiler] estimated_size 0.0004
[DeviceMgr] getting client for keystore
[DeviceMgr] scanning devices...
[DeviceMgr] end client for keystore
Traceback (most recent call last):
File "/home/spot/Electron Cash-2.9.2/gui/qt/util.py", line 582, in run
result = task.task()
File "/home/spot/Electron Cash-2.9.2/lib/wallet.py", line 1103, in sign_transaction
k.sign_transaction(tx, password)
File "/home/spot/Electron Cash-2.9.2/plugins/trezor/plugin.py", line 66, in sign_transaction
self.plugin.sign_transaction(self, tx, prev_tx, xpub_path)
File "/home/spot/Electron Cash-2.9.2/plugins/trezor/plugin.py", line 240, in sign_transaction
inputs = self.tx_inputs(tx, True)
File "/home/spot/Electron Cash-2.9.2/plugins/trezor/plugin.py", line 307, in tx_inputs
txinputtype.amount = txin['value']
AttributeError: 'TxInputType' object has no attribute 'amount'

@molecular had the solution! Python-trezor needed updating to master branch. Clone master and setup.py install.

Yes! Thank you @molecular and @anduck !

Cloned python-trezor master and installed, also had to update cython3 but I just got my send tx signed and broadcast. Now I just have to wait a few days to get a few BCH confirmations hah.

reopening because we should remove this locktime thing

since the original issue was not about the locktime, but about trezorlib being old, I made a new issue #85 for the locktime thing.

So this can be closed to reduce confusion.

@spottedmarley can you still reproduce the locktime thing with updated python-trezor at all?

sign_tx() got an unexpected keyword argument 'locktime'

I made an issue for that: #85, could you be so kind to see if this still occurs and post your results to #85

Both problems are caused by an older python-trezor version. locktime and amount were added recently. And amount is absolutely necessary for BIP-143 signatures.

@jhoenicke yes, thanks for the input.

All of #63, #81 and #85 are really "python-trezor too old (< v0.7.13)"

Was this page helpful?
0 / 5 - 0 ratings