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

Change client network from one to another doesn't seem to work on Python #17

Closed
BritikovKI opened this issue Aug 9, 2020 · 4 comments
Closed

Comments

@BritikovKI
Copy link

Steps to reproduce

  1. Followed the steps of the tutorial here: https://in3.readthedocs.io/en/develop/api-python.html
  2. Pasted connect_to_ethereum code.
  3. Received an error, while trying to connect to the Kovan network and reasssign client variable.(it crashes not on the reassignment, but on the call of block_number method)

Expected behavior

Successful connection to another network, and work with it.

Actual behavior

Error:

Traceback (most recent call last):
File "test.py", line 15, in
latest_block = client.eth.block_number()
File "/home/konst/PycharmProjects/registrar/venv/lib/python3.7/site-packages/in3/eth/api.py", line 47, in block_number
return self._factory.get_integer(self._runtime.call(EthMethods.BLOCK_NUMBER))
File "/home/konst/PycharmProjects/registrar/venv/lib/python3.7/site-packages/in3/libin3/runtime.py", line 63, in call
raise ClientException(str(error))
in3.exception.ClientException: b"argument should be integer or bytes-like object, not 'str'"

System configuration

LinuxMint 19.3 (tricia). Kernel 5.3.0-62.
Python: 3.7

Incubed version

Latest version for pip

Request

eth.block_number()

Incubed Configuration

default

Chain

it is not important, it crashes on all transitions from one chain to another

@BritikovKI BritikovKI changed the title Change client from one to another doesn't seem to work Change client network from one to another doesn't seem to work on Python Aug 9, 2020
@simon-jentzsch
Copy link
Contributor

Thanks for reporting. I tested the example on mac and on ubuntu with the latest in3 version (3.0.1) and it worked. Maybe you can retest it after pip3 install -U in3.

@cerealkill
Copy link
Contributor

I could reproduce on in3==2.5.4 but not on 3.0.1. Upgrading should remove the issue.

@cerealkill
Copy link
Contributor

@BritikovKI Investigating the issue further, it is a bug in Python's http.client.HTTPConnection Sockets handling. We moved away from it in the 3.0.1 to use urllib.

@BritikovKI
Copy link
Author

Thanks for responses, I will update incubed then.

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

3 participants