polkascan / py-substrate-interface

Python Substrate Interface
https://polkascan.github.io/py-substrate-interface/
Apache License 2.0
239 stars 111 forks source link

(fix) mpz has no attribute to_bytes py311 #353

Closed MementoRC closed 4 months ago

MementoRC commented 10 months ago

When running test_keypais.py, I get:

FAILED test/test_keypair.py::KeyPairTestCase::test_create_ecdsa_keypair_mnemonic - AttributeError: 'mpz' object has no attribute 'to_bytes'
FAILED test/test_keypair.py::KeyPairTestCase::test_create_ecdsa_keypair_uri - AttributeError: 'mpz' object has no attribute 'to_bytes'
FAILED test/test_keypair.py::KeyPairTestCase::test_sign_and_verify_ecdsa - AttributeError: 'mpz' object has no attribute 'to_bytes'
FAILED test/test_keypair.py::KeyPairTestCase::test_sign_and_verify_invalid_signature_ecdsa - AttributeError: 'mpz' object has no attribute 'to_bytes'
FAILED test/test_keypair.py::KeyPairTestCase::test_sign_and_verify_public_ethereum_address - AttributeError: 'mpz' object has no attribute 'to_bytes'

It seems to be due to BIP32_CURVE.order() not being an int. It is also an issue with the x() and y() returns

MementoRC commented 8 months ago

@arjanz This is needed for the conda recipe: https://github.com/conda-forge/staged-recipes/pull/23812 to pass the tests, any chances to review and assess if there is a better resolution?