Skip to content

init commit of async contract #2377

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

Merged
merged 16 commits into from
Mar 10, 2022

Conversation

dbfreem
Copy link
Contributor

@dbfreem dbfreem commented Mar 4, 2022

init commit of async contract see PR #2370

@dbfreem
Copy link
Contributor Author

dbfreem commented Mar 4, 2022

@pacrob Here is the AsyncEthereumTester and Contract parts of my other PR. I closed that PR.

One problem we will need to overcome with removing the ENS work is that contract is reliant on ENS there are other examples in there too. The problem I ran into while testing was that the w3 instance that is being used to create the AsyncContract has a AsyncEth Module in it. This web3 instance also has a standard ENS in it. When ens is called from AsyncContract the AsyncEth module is then used to call web3.eth.call which is async but ens is expecting it not to be async. Hope that all makes sense.

There may be a way around this like maybe not allowing ens addresses to be passed into AsyncContract until ENS is asyncified.

Thoughts??

Also, let me know what parts of async contract you want to work on and I can pick some of the left over parts.

Thanks, for setting this feature branch of for collaborating.

@dbfreem
Copy link
Contributor Author

dbfreem commented Mar 4, 2022

Just FYI, somewhere along the lines of moving the ENS out and fixing linting errors, a few of the test broke, Will look at these this evening as well as finish up the linting

@dbfreem
Copy link
Contributor Author

dbfreem commented Mar 7, 2022

I cleaned up some of the linting, and going to start on ContractEvents/ContractEvent

@pacrob
Copy link
Contributor

pacrob commented Mar 8, 2022

I've been working on trying to resolve the linting but not much success today. Will continue tomorrow.

I think because this PR has the main class restructuring, we should get it in before I start changing anything further.

On the ENS dependency, is it just the calls to normalize_address that require the ENS object? If that's the only place, we could add a non-ens version of the normalizer or something similar.

@dbfreem
Copy link
Contributor Author

dbfreem commented Mar 8, 2022

So I almost have the Main BaseContract/Contract/AsyncContract done with the exception of a couple methods. I think it is just be the normalizer that was using ens so that's would probably work making a non ens version of it. I hope to finish that up later this evening or tommorrow.

The ENS part is isolated so you could probably work on the normalizer piece without conflicts until I finish the may contract object.

@pacrob
Copy link
Contributor

pacrob commented Mar 8, 2022

Sounds good. I've added a normalize_address_no_ens function to the main feature branch.

@dbfreem
Copy link
Contributor Author

dbfreem commented Mar 9, 2022

Here is where I am at. I have that one weird lint error where it is complaining about the web3_module but besides that I "think" contract is for the "most part" done.

I pulled in your normalize_address_no_ens and used it in the AsyncContract

The next thing I was going to look at is ContractConstructor. It has some pieces that need to be async.

@pacrob pacrob merged commit c7bbd24 into ethereum:asyncify-contract Mar 10, 2022
@pacrob
Copy link
Contributor

pacrob commented Mar 10, 2022

Looks good. With that structure in, should be easier to work on in chunks.

I pulled it in with the lint failing, but it looks like reverting that ignore type line in web3/_utils/module_testing/web3_module.py fixes it. Is there another reason for removing it?

@dbfreem
Copy link
Contributor Author

dbfreem commented Mar 10, 2022

So one time I would run lint and it would tell me the typing wasn't right on that line and another time it would say that the type ignore was wrong. So probably just my local env being flaky. If removing the type ignore works then that is fine with me.

pacrob pushed a commit to pacrob/web3.py that referenced this pull request Mar 31, 2022
Create Base/Async structure for ContractFunctions, ContractEvents, Contract, ContractConstructor, ContractFunction, ContractEvent, ContractCaller classes
pacrob pushed a commit to pacrob/web3.py that referenced this pull request Apr 13, 2022
Create Base/Async structure for ContractFunctions, ContractEvents, Contract, ContractConstructor, ContractFunction, ContractEvent, ContractCaller classes
pacrob pushed a commit to pacrob/web3.py that referenced this pull request Apr 23, 2022
Create Base/Async structure for ContractFunctions, ContractEvents, Contract, ContractConstructor, ContractFunction, ContractEvent, ContractCaller classes
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.

2 participants