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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'mpz' object has no attribute 'to_bytes' #2021

Closed
ProfessorVenkman opened this issue Oct 18, 2020 · 1 comment
Closed

AttributeError: 'mpz' object has no attribute 'to_bytes' #2021

ProfessorVenkman opened this issue Oct 18, 2020 · 1 comment
Labels
Fixed Fixed in latest git master

Comments

@ProfessorVenkman
Copy link

ProfessorVenkman commented Oct 18, 2020

Crash Report

This crash report was reported through the automatic crash reporting system 馃

Traceback

  File "/usr/lib/python3.7/site-packages/electroncash/util.py", line 730, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "/usr/lib/python3.7/site-packages/electroncash/network.py", line 1411, in run
    self.wait_on_sockets()
  File "/usr/lib/python3.7/site-packages/electroncash/network.py", line 1385, in wait_on_sockets
    self.process_responses(interface)
  File "/usr/lib/python3.7/site-packages/electroncash/network.py", line 814, in process_responses
    self.process_response(interface, request, response, callbacks)
  File "/usr/lib/python3.7/site-packages/electroncash/network.py", line 759, in process_response
    callback(response)
  File "/usr/lib/python3.7/site-packages/electroncash/verifier.py", line 150, in verify_merkle
    self.wallet.save_verified_tx(write=True)
  File "/usr/lib/python3.7/site-packages/electroncash/wallet.py", line 306, in save_verified_tx
    self.storage.write()
  File "/usr/lib/python3.7/site-packages/electroncash/util.py", line 316, in <lambda>
    return lambda *args, **kw_args: do_profile(args, kw_args)
  File "/usr/lib/python3.7/site-packages/electroncash/util.py", line 312, in do_profile
    o = func(*args, **kw_args)
  File "/usr/lib/python3.7/site-packages/electroncash/storage.py", line 177, in write
    self._write()
  File "/usr/lib/python3.7/site-packages/electroncash/storage.py", line 189, in _write
    s = bitcoin.encrypt_message(c, self.pubkey)
  File "/usr/lib/python3.7/site-packages/electroncash/bitcoin.py", line 540, in encrypt_message
    return EC_KEY.encrypt_message(message, bfh(pubkey))
  File "/usr/lib/python3.7/site-packages/electroncash/bitcoin.py", line 697, in encrypt_message
    ecdh_key = point_to_ser(pk * ephemeral.privkey.secret_multiplier)
  File "/usr/lib/python3.7/site-packages/electroncash/ecc_fast.py", line 132, in mul
    public_pair_bytes = b'\4' + self.x().to_bytes(32, byteorder="big") + self.y().to_bytes(32, byteorder="big")

AttributeError: 'mpz' object has no attribute 'to_bytes'

Reporter

This issue was reported by 3 user(s):

Electron Cash Version Python Version Operating System Wallet Type Locale
4.0.2 3.7.8 (default, Oct 18 2020, 15:57:30) [GCC 9.3.0] Linux-5.4.38-gentoo-x86_64-x86_64-Intel-R-_Core-TM-i5-6600_CPU@_3.30GHz-with-gentoo-2.7 imported_privkey en_US
4.0.2 3.7.9 (default, Oct 20 2020, 12:20:36) [GCC 8.4.0] Linux-5.8.18-gentoo-x86_64-x86_64-Intel-R-_Core-TM-i9-10980XE_CPU@_3.00GHz-with-gentoo-2.7 standard en_GB
4.0.2 3.7.9 (default, Oct 20 2020, 12:20:36) [GCC 8.4.0] Linux-5.8.18-gentoo-x86_64-x86_64-Intel-R-_Core-TM-i9-10980XE_CPU@_3.00GHz-with-gentoo-2.7 standard en_GB

Additional Information

The reporting user(s) did not provide additional information.

@cculianu
Copy link
Collaborator

This has been fixed in newer Electron Cash post 4.1.1.

@cculianu cculianu added the Fixed Fixed in latest git master label Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed Fixed in latest git master
Projects
None yet
Development

No branches or pull requests

2 participants