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

pypechain: code reuse with format_code and write_code #861

Merged
merged 2 commits into from
Sep 20, 2023

Conversation

wakamex
Copy link
Contributor

@wakamex wakamex commented Sep 7, 2023

No description provided.

@vercel
Copy link

vercel bot commented Sep 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
elf-simulations ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 20, 2023 5:19pm

sentilesdal
sentilesdal previously approved these changes Sep 8, 2023
Copy link
Contributor

@sentilesdal sentilesdal left a comment

Choose a reason for hiding this comment

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

this is a great idea, love that we can do this so easily!

lib/pypechain/pypechain/run_pypechain.py Outdated Show resolved Hide resolved
@wakamex wakamex changed the title pypechain: code reuse with format_and_write_code pypechain: code reuse with format_code and write_code Sep 15, 2023
@wakamex
Copy link
Contributor Author

wakamex commented Sep 20, 2023

rebased 🙌

@sentilesdal
Copy link
Contributor

please run this on the code first to make sure the codegen isn't garbled before you merge

@wakamex
Copy link
Contributor Author

wakamex commented Sep 20, 2023

changes on ERC20Contract.py from main to this PR are all style changes from black, and removing some trailing commas:

1c1
< #pylint: disable=invalid-name
---
> # pylint: disable=invalid-name
4d3
< 
17a17
> 
28a29
> 
39a41
> 
48c50
<     def __call__(self, ) -> "ERC20DecimalsContractFunction":
---
>     def __call__(self) -> "ERC20DecimalsContractFunction":
50a53
> 
59c62,64
<     def __call__(self, spender: str, subtractedValue: int) -> "ERC20DecreaseAllowanceContractFunction":
---
>     def __call__(
>         self, spender: str, subtractedValue: int
>     ) -> "ERC20DecreaseAllowanceContractFunction":
61a67
> 
70c76,78
<     def __call__(self, spender: str, addedValue: int) -> "ERC20IncreaseAllowanceContractFunction":
---
>     def __call__(
>         self, spender: str, addedValue: int
>     ) -> "ERC20IncreaseAllowanceContractFunction":
72a81
> 
81c90
<     def __call__(self, ) -> "ERC20NameContractFunction":
---
>     def __call__(self) -> "ERC20NameContractFunction":
83a93
> 
92c102
<     def __call__(self, ) -> "ERC20SymbolContractFunction":
---
>     def __call__(self) -> "ERC20SymbolContractFunction":
94a105
> 
103c114
<     def __call__(self, ) -> "ERC20TotalSupplyContractFunction":
---
>     def __call__(self) -> "ERC20TotalSupplyContractFunction":
105a117
> 
116a129
> 
125c138,140
<     def __call__(self, _from: str, to: str, amount: int) -> "ERC20TransferFromContractFunction":
---
>     def __call__(
>         self, _from: str, to: str, amount: int
>     ) -> "ERC20TransferFromContractFunction":
127a143
> 
132,133d147
< 
< 
138d151
< 
140d152
< 
142d153
< 
144d154
< 
146d155
< 
148d156
< 
150d157
< 
152d158
< 
154d159
< 
156d160
< 
167,168c171,175
<         self.address = address if address else cast(ChecksumAddress, "0x0000000000000000000000000000000000000000")
< 
---
>         self.address = (
>             address
>             if address
>             else cast(ChecksumAddress, "0x0000000000000000000000000000000000000000")
>         )
172d178
< 
178,179c184
< 
<     functions: ERC20ContractFunctions
\ No newline at end of file
---
>     functions: ERC20ContractFunctions

@wakamex wakamex merged commit 6dd398b into main Sep 20, 2023
6 checks passed
@wakamex wakamex deleted the pypechain_code_reuse_with_format_and_write_code branch September 20, 2023 18:27
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