Skip to content

Allow STATICCALL using raw_call#1973

Merged
fubuloubu merged 3 commits into
vyperlang:masterfrom
iamdefinitelyahuman:feat-raw_call-static
May 15, 2020
Merged

Allow STATICCALL using raw_call#1973
fubuloubu merged 3 commits into
vyperlang:masterfrom
iamdefinitelyahuman:feat-raw_call-static

Conversation

@iamdefinitelyahuman

Copy link
Copy Markdown
Contributor

What I did

Add is_static_call kwarg to raw_call as a way to perform a STATICCALL.

Closes #1971

How I did it

Minor tweaks to the RawCall.build_LLL logic in vyper/functions/functions.py:

  • use of is_static_call and is_delegate_call together raises
  • raw_call may now be used in @constant functions, ONLY when is_static_call=True. If the kwarg is omitted, the exception message suggests it's use to the user.

How to verify it

Run the tests. I added a few cases to verify that it works.

Cute Animal Picture

image

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #1973 into master will increase coverage by 0.00%.
The diff coverage is 77.77%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1973   +/-   ##
=======================================
  Coverage   87.16%   87.17%           
=======================================
  Files          58       58           
  Lines        6631     6636    +5     
  Branches     1674     1677    +3     
=======================================
+ Hits         5780     5785    +5     
  Misses        536      536           
  Partials      315      315           
Impacted Files Coverage Δ
vyper/functions/functions.py 92.33% <77.77%> (+0.06%) ⬆️

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 e4ae6c0...2fb0a9a. Read the comment docs.

@fubuloubu fubuloubu merged commit 7498013 into vyperlang:master May 15, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the feat-raw_call-static branch May 19, 2020 17:09
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.

Allow STATICCALL in raw_call

3 participants