delvtech / pypechain

Static Python bindings for Ethereum smart contracts.
Apache License 2.0
9 stars 2 forks source link

Deploy linking in pypechain. Includes version bump to v0.0.37 #125

Closed slundqui closed 3 months ago

slundqui commented 3 months ago

https://github.com/delvtech/pypechain/issues/118

This PR handles the case where bytecode requires a linked reference to a previously deployed contract. Here, the python generated types add in a required link_references argument to deploy if this is found in the abi.

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 65.90909% with 120 lines in your changes missing coverage. Please review.

Project coverage is 63.81%. Comparing base (2149702) to head (b718d6b).

Files with missing lines Patch % Lines
pypechain/test/deploy_linking/types/utilities.py 32.14% 38 Missing :warning:
pypechain/render/contract.py 17.64% 14 Missing :warning:
pypechain/utilities/bytecode.py 41.66% 14 Missing :warning:
conftest.py 7.14% 13 Missing :warning:
...ain/test/deploy_linking/types/MyLibraryContract.py 80.30% 13 Missing :warning:
pypechain/foundry/utilities.py 25.00% 9 Missing :warning:
...hain/test/deploy_linking/types/ContractContract.py 91.54% 6 Missing :warning:
pypechain/utilities/abi.py 42.85% 4 Missing :warning:
pypechain/test/structs/types/StructsAContract.py 50.00% 3 Missing :warning:
pypechain/test/structs/types/StructsBContract.py 50.00% 3 Missing :warning:
... and 1 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #125 +/- ## ========================================== + Coverage 63.42% 63.81% +0.39% ========================================== Files 49 53 +4 Lines 2570 2783 +213 ========================================== + Hits 1630 1776 +146 - Misses 940 1007 +67 ``` | [Flag](https://app.codecov.io/gh/delvtech/pypechain/pull/125/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=delvtech) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/delvtech/pypechain/pull/125/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=delvtech) | `63.81% <65.90%> (+0.39%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=delvtech#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.