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

[BUG] IsPayToColdStaking tries to parse empty rawTX with Trezor api #9

Merged
merged 2 commits into from
Dec 23, 2020

Conversation

random-zebra
Copy link
Contributor

Closes #8

@random-zebra random-zebra added the Bug Something isn't working label Nov 11, 2020
@random-zebra random-zebra self-assigned this Nov 11, 2020
@jp-solutionz
Copy link

Currently testing Win 10 produces the following error:
C:\Users\JP\Downloads\PET4L-202011_fix-IsPayToColdStaking-trezor\PET4L-202011_fix-IsPayToColdStaking-trezor>pet4l.py
Traceback (most recent call last):
File "C:\Users\JP\Downloads\PET4L-202011_fix-IsPayToColdStaking-trezor\PET4L-202011_fix-IsPayToColdStaking-trezor\pet4l.py", line 31, in
from mainApp import App
File "C:\Users\JP\Downloads\PET4L-202011_fix-IsPayToColdStaking-trezor\PET4L-202011_fix-IsPayToColdStaking-trezor\src\mainApp.py", line 17, in
from mainWindow import MainWindow
File "C:\Users\JP\Downloads\PET4L-202011_fix-IsPayToColdStaking-trezor\PET4L-202011_fix-IsPayToColdStaking-trezor\src\mainWindow.py", line 20, in
from hwdevice import HWdevice
File "C:\Users\JP\Downloads\PET4L-202011_fix-IsPayToColdStaking-trezor\PET4L-202011_fix-IsPayToColdStaking-trezor\src\hwdevice.py", line 15, in
from trezorClient import TrezorApi
File "C:\Users\JP\Downloads\PET4L-202011_fix-IsPayToColdStaking-trezor\PET4L-202011_fix-IsPayToColdStaking-trezor\src\trezorClient.py", line 13, in
from trezorlib import btc, exceptions, messages as trezor_proto, coins
ImportError: cannot import name 'coins' from 'trezorlib' (C:\Users\JP\AppData\Local\Programs\Python\Python39-32\lib\site-packages\trezorlib_init_.py)

@random-zebra
Copy link
Contributor Author

This is probably caused by a recent change in trezorlib.
Please check that your version is not higher than v0.11.1 (will set it as maximum version in requirements.txt).

@jp-solutionz
Copy link

jp-solutionz commented Nov 12, 2020

Okay the application now launches (python 3.9) after running "pip install trezor==0.11.1" (installed version was 0.12.2) however does not connect to any servers.

Also attempted downgrading to python 3.8 and following packages with same result:
python-bitcoinrpc==1.0
bitcoin==1.1.42
btchip-python==0.1.27
trezor==0.11.1
PyQt5==5.14.0
requests==2.18.4
simplejson==3.17.2
ecdsa==0.16.0

The latest binary connects ok and I've disabled firewall etc and however I can't get either this branch or "master branch" or "2019_cold_staking_ledger" to connect so possibly something wrong with my config.

PET4L_Logs_2020-11-12_07-55-40.txt

@jp-solutionz
Copy link

I've also tried the "PyQt-5.9" release on Python 3.7.0 with the same result:

https://github.com/PIVX-Project/PET4L/archive/v0.1.0-c.zip
python-bitcoinrpc==1.0
bitcoin==1.1.42
btchip-python==0.1.27
trezor==0.11.1
PyQt5==5.9.0
requests==2.18.4
simplejson==3.17.2
ecdsa==0.16.0

The wallet is able to check for new version and prompt for update so network stack seems fine however errors connecting to RPC server so perhaps there another dependency issue (binary version connects fine to same servers).

2020-11-12 18:52:07 : Checking PET4L version...
===> Remote version: 0.1.1
2020-11-12 18:52:13 : Trying to connect to RPC https://amsterdam.randomzebra.party:8080...
2020-11-12 18:52:15 : Connection to RPC server failed.
EXCEPTION
caller : run
function : updateRPCstatus
err: [WinError 10061] No connection could be made because the target machine actively refused it
===> Exception in RPC client
EXCEPTION
caller : run
function : updateRPCstatus
err: cannot unpack non-iterable NoneType object
===> exception updating RPC status:

PET4L_Logs_2020-11-12_18-52-56.txt

@random-zebra
Copy link
Contributor Author

random-zebra commented Nov 12, 2020

Mhm quite strange. Maybe an issue with either httplib or ssl modules (though they should be shipped already with python).

Anyway... I tested this with Trezor Model T on a Windows VM, and it works here.

I've built binaries and uploaded them here for testing:
https://github.com/PIVX-Project/PET4L/releases/tag/v0.1.1-a-PR9

@jp-solutionz
Copy link

Great work @random-zebra !

I've tested the binary and was able to send the full balance from address #1 to address #2.

I'll also test on the original wallet and report back if any issues. Thanks for your help!

@random-zebra
Copy link
Contributor Author

Glad it worked! Cheers 🥃

@jp-solutionz
Copy link

Just tested the binary with Ledger Nano S and address 0 is correct however subsequent addresses differ from Ledger Live so any balances in change addresses previously used by Ledger Live transactions are not displayed.

This may be due to Ledger Live using path m/44'/77'/0' as opposed to Trezor etc which uses m/44'/119'/0'.

Perhaps an option is needed to select the correct path.

@random-zebra
Copy link
Contributor Author

@jp-solutionz have you switched internal/external to 1 for change addresses?

@random-zebra random-zebra merged commit 59dec71 into master Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support sending PIVX balance from TREZOR Model T
2 participants