-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Clean up AsyncHTTPProvider
instantiation
#2736
Merged
fselmo
merged 5 commits into
ethereum:master
from
fselmo:clean-up-async-provider-instantiation
Dec 2, 2022
Merged
Clean up AsyncHTTPProvider
instantiation
#2736
fselmo
merged 5 commits into
ethereum:master
from
fselmo:clean-up-async-provider-instantiation
Dec 2, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fselmo
force-pushed
the
clean-up-async-provider-instantiation
branch
3 times, most recently
from
November 23, 2022 00:34
a09f5fd
to
955e539
Compare
- Add ``is_async`` flag to base provider classes and appropriately set them to ``True`` or ``False``. - Use these flags to determine whether to load sync or async default middlewares and default modules.
fselmo
force-pushed
the
clean-up-async-provider-instantiation
branch
4 times, most recently
from
November 29, 2022 00:57
c0cc52d
to
d4f6fad
Compare
- Also minor cleanup that came along with these changes: e.g. expect a more specific error, ``NameNotFound`` for ens test since the async version started to wrongly xpass.
fselmo
force-pushed
the
clean-up-async-provider-instantiation
branch
from
November 29, 2022 01:16
d4f6fad
to
7882513
Compare
fselmo
force-pushed
the
clean-up-async-provider-instantiation
branch
from
November 29, 2022 01:37
7882513
to
e087a46
Compare
pacrob
reviewed
Nov 30, 2022
|
||
|
||
def test_web3_with_async_http_provider_has_default_middlewares_and_modules() -> None: | ||
async_w3 = Web3(AsyncHTTPProvider(endpoint_uri="http://mynode.local:8545")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can use URI
here
pacrob
approved these changes
Nov 30, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small update noted, otherwise lgtm! thanks!
- No need for the ``Net`` module to be the only one to have to `cast` values because the `net` property on `Web3` is a `Union[Net, AsyncNet]`. Instead, set it like the others and make one decision for all at the same time in an upcoming PR.
fselmo
force-pushed
the
clean-up-async-provider-instantiation
branch
from
December 2, 2022 01:23
4231169
to
f06e3cd
Compare
fselmo
added a commit
that referenced
this pull request
Dec 2, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was wrong?
Related to #1416. This is listed as non-breaking but instead of having an
async_net
module, it seems more appropriate to set thenet
module up as theAsyncNet
class. This will break things.How was it fixed?
is_async
flag to base provider classes and appropriately set them toTrue
orFalse
.Web3
propertyasync_net
asnet
mapped toAsyncNet
class when dealing with async andNet
when dealing with sync.Todo:
Cute Animal Picture
___ O>
/\ /\