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

feat: support loading types from ethPM Manifest #2628

Merged

Conversation

fubuloubu
Copy link
Member

@fubuloubu fubuloubu commented Feb 4, 2022

What I did

Allow loading ABI types from ethPM manifest files

How I did it

Hacking

How to verify it

The whole imports system needs a lot of work

Description for the changelog

Load interfaces from an ethPM Manifest file

Cute Animal Picture

peakaboo

@codecov-commenter
Copy link

codecov-commenter commented Feb 4, 2022

Codecov Report

Merging #2628 (f866687) into master (82f44ee) will decrease coverage by 0.24%.
The diff coverage is 21.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2628      +/-   ##
==========================================
- Coverage   86.55%   86.30%   -0.25%     
==========================================
  Files          92       92              
  Lines        9460     9494      +34     
  Branches     2400     2415      +15     
==========================================
+ Hits         8188     8194       +6     
- Misses        781      805      +24     
- Partials      491      495       +4     
Impacted Files Coverage Δ
vyper/cli/vyper_compile.py 68.70% <0.00%> (-3.88%) ⬇️
vyper/cli/vyper_json.py 79.78% <23.07%> (-5.65%) ⬇️
vyper/cli/utils.py 88.09% <50.00%> (-4.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 82f44ee...f866687. Read the comment docs.

@charles-cooper
Copy link
Member

also maybe add a test

@fubuloubu fubuloubu force-pushed the feat/ethpm-manifest-imports branch 2 times, most recently from 3c4e8b9 to 6f53030 Compare February 8, 2022 01:09
@fubuloubu
Copy link
Member Author

Tested locally by using Brownie (which uses JSON mode to compile) and downloaded copy of OpenZeppelin/openzeppelin-contracts converted to ethPM manifest format (using Ape)

@fubuloubu
Copy link
Member Author

Like to note this code is really hacky and should be refactored so it finds the different types of interfaces faster:

from location import Bar  # can either be `location/Bar.{vy|json}` or `location.json:Bar`

@charles-cooper charles-cooper merged commit e02f475 into vyperlang:master Feb 11, 2022
@fubuloubu fubuloubu deleted the feat/ethpm-manifest-imports branch February 12, 2022 04:00
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.

None yet

3 participants