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

Add POA middleware #602

Merged
merged 2 commits into from
Jun 4, 2020
Merged

Add POA middleware #602

merged 2 commits into from
Jun 4, 2020

Conversation

iamdefinitelyahuman
Copy link
Member

What I did

Add geth_poa_middleware when connecting to a POA network

Closes #583

How I did it

After connecting, call web3.eth.getBlock('latest') and catch ExtraDataLengthError. If this exception is raised, add the required middleware.

How to verify it

Run the tests. I added a test case to confirm connection to rinkeby works.

matnad
matnad previously approved these changes Jun 4, 2020
Copy link
Collaborator

@matnad matnad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Collaborator

@matnad matnad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@iamdefinitelyahuman iamdefinitelyahuman merged commit c9ff065 into master Jun 4, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the feat-poa-middleware branch June 4, 2020 18:02
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

Successfully merging this pull request may close these issues.

Cannot use POA networks without web3 middleware
2 participants