PatrickAlphaC / web3_py_simple_storage

47 stars 78 forks source link

Update deploy.py to fix the error "web3.exceptions.ExtraDataLengthError: The field extraData is 97 bytes, but should be 32. It is quite likely that you are connected to a POA chain" #37

Closed Tatendaz closed 2 years ago

Tatendaz commented 2 years ago

Added middleware injection incase you are getting an error when deploying to rinkbey. Error stack looks like the below

web3.exceptions.ExtraDataLengthError: The field extraData is 97 bytes, but should be 32. It is quite likely that you are connected to a POA chain. Refer to http://web3py.readthedocs.io/en/stable/middleware.html#geth-style-proof-of-authority for more details. The full extraData is: HexBytes('0xd683010a17846765746886676f312e3139856c696e7578000000000000000000435ab9eabfd7f6221c7bb33f4aa50f62b888d258f065ed49838b62b3562ad73833fa038ee6b983428def93a184d61662e4debb02de16a8075f1ea4479bbfdf9e00')

PatrickAlphaC commented 2 years ago

This is great! Can you make this an if statement? Like if chain_id == 4: use middleware ?