-
-
Notifications
You must be signed in to change notification settings - Fork 810
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2433 from charles-cooper/export_layout
export the storage layout
- Loading branch information
Showing
12 changed files
with
99 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from vyper.compiler import compile_code | ||
|
||
|
||
def test_method_identifiers(): | ||
code = """ | ||
foo: HashMap[address, uint256] | ||
baz: Bytes[65] | ||
bar: uint256 | ||
@external | ||
@nonreentrant("foo") | ||
def public_foo(): | ||
pass | ||
@internal | ||
@nonreentrant("bar") | ||
def _bar(): | ||
pass | ||
@external | ||
@nonreentrant("bar") | ||
def public_bar(): | ||
pass | ||
""" | ||
|
||
out = compile_code(code, output_formats=["layout"],) | ||
|
||
assert out["layout"] == { | ||
"nonreentrant.foo": {"type": "nonreentrant lock", "location": "storage", "slot": 0}, | ||
"nonreentrant.bar": {"type": "nonreentrant lock", "location": "storage", "slot": 2}, | ||
"foo": { | ||
"type": "HashMap[address, uint256][address, uint256]", | ||
"location": "storage", | ||
"slot": 3, | ||
}, | ||
"baz": {"type": "Bytes[65]", "location": "storage", "slot": 4}, | ||
"bar": {"type": "uint256", "location": "storage", "slot": 9}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters