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

Add support for all base types when importing interface from ABI #3154

Merged
merged 1 commit into from
Nov 22, 2022

Conversation

benber86
Copy link
Contributor

What I did

Importing interfaces from ABI failed with some types such as uint8.
For instance, importing the following interface:

[
    {
      "constant": true,
      "inputs": [],
      "name": "decimals",
      "outputs": [{ "name": "", "type": "uint8" }],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    }
  ]

Will cause an error: vyper.exceptions.StructureException: Type uint8 not supported by vyper.

How I did it

Changed supported types in ast to abi conversion in interface.py from ("int128", "uint256", "bool", "address", "bytes32") to {"address", "bool"} | BYTES_M_TYPES | INTEGER_TYPES.

How to verify it

Importing the interface from the snippet above.

Commit message

Add support for all base types when importing interface from ABI

Description for the changelog

Cute Animal Picture

image

@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2022

Codecov Report

Merging #3154 (5df80fc) into master (80dcf5e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3154   +/-   ##
=======================================
  Coverage   88.49%   88.49%           
=======================================
  Files          95       95           
  Lines       10778    10779    +1     
  Branches     2268     2268           
=======================================
+ Hits         9538     9539    +1     
  Misses        797      797           
  Partials      443      443           
Impacted Files Coverage Δ
vyper/ast/signatures/interface.py 81.81% <100.00%> (+0.33%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@charles-cooper charles-cooper merged commit 97350db into vyperlang:master Nov 22, 2022
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.

3 participants