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

export the storage layout #2433

Merged
merged 2 commits into from
Aug 27, 2021

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Aug 26, 2021

What I did

Implement #1950

How I did it

How to verify it

Compile with -f layout

(vyper) $ cat tmp/nonreentrant.vy 
bar: uint256

@external
@nonreentrant("lock")
def foo():
    foo: uint256 = 0
(vyper) $ vyper -f layout tmp/nonreentrant.vy  | jq ''
{
  "nonreentrant.lock": {
    "type": "nonreentrant lock",
    "location": "storage",
    "slot": 0
  },
  "bar": {
    "type": "uint256",
    "location": "storage",
    "slot": 1
  }
}

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2021

Codecov Report

Merging #2433 (6d91720) into master (be9d307) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head 6d91720 differs from pull request most recent head 99a8961. Consider uploading reports for the commit 99a8961 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2433      +/-   ##
==========================================
+ Coverage   84.62%   84.65%   +0.02%     
==========================================
  Files          94       94              
  Lines        9423     9441      +18     
  Branches     2205     2207       +2     
==========================================
+ Hits         7974     7992      +18     
  Misses        939      939              
  Partials      510      510              
Impacted Files Coverage Δ
vyper/cli/vyper_compile.py 75.22% <ø> (ø)
vyper/cli/vyper_json.py 85.20% <ø> (ø)
vyper/compiler/__init__.py 85.71% <ø> (ø)
vyper/evm/opcodes.py 100.00% <ø> (ø)
vyper/ovm/transpile_lll.py 63.97% <ø> (ø)
vyper/builtin_functions/functions.py 88.48% <100.00%> (ø)
vyper/compiler/output.py 97.16% <100.00%> (+0.06%) ⬆️
vyper/compiler/phases.py 87.85% <100.00%> (+0.59%) ⬆️
vyper/semantics/validation/data_positions.py 93.10% <100.00%> (+3.10%) ⬆️
vyper/typing.py 100.00% <100.00%> (ø)

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 be9d307...99a8961. Read the comment docs.

@charles-cooper charles-cooper changed the title [draft] export the storage layout export the storage layout Aug 26, 2021
@@ -13,6 +13,7 @@ def test_combined_json_keys(tmp_path):
"bytecode_runtime",
"abi",
"source_map",
"storage_layout",
Copy link
Member

Choose a reason for hiding this comment

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

the other ones are just layout?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why I did this lol but I used "layout" for the cli flag and "storage_layout" internally

Copy link
Member

Choose a reason for hiding this comment

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

I'd say just do one or the other

@charles-cooper
Copy link
Member Author

@fubuloubu I slightly modified some behavior in f792c45, could you take a look? I don't think it's a breaking change but it may deserve its own PR.

@fubuloubu
Copy link
Member

@fubuloubu I slightly modified some behavior in f792c45, could you take a look? I don't think it's a breaking change but it may deserve its own PR.

I wouldn't call it a breaking change persay (more of an optimization), but definitely should be it's own PR

@charles-cooper
Copy link
Member Author

@fubuloubu I opened a followup PR for the optimization #2439

@charles-cooper charles-cooper merged commit 63ef152 into vyperlang:master Aug 27, 2021
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