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[lang]!: change the signature of block.prevrandao #3879

Merged
merged 4 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/functional/syntax/test_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def foo():
"""
@external
def foo():
x: uint256 = block.prevrandao + 185
x: bytes32 = block.prevrandao
if tx.origin == self:
y: Bytes[35] = concat(block.prevhash, b"dog")
""",
Expand Down
2 changes: 1 addition & 1 deletion vyper/codegen/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def parse_Attribute(self):
warning = "tried to use block.prevrandao in pre-Paris "
warning += "environment! Suggest using block.difficulty instead."
vyper_warn(warning, self.expr)
return IRnode.from_list(["prevrandao"], typ=UINT256_T)
return IRnode.from_list(["prevrandao"], typ=BYTES32_T)
elif key == "block.difficulty":
if version_check(begin="paris"):
warning = "tried to use block.difficulty in post-Paris "
Expand Down
2 changes: 1 addition & 1 deletion vyper/semantics/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _Block(_EnvType):
_type_members = {
"coinbase": AddressT(),
"difficulty": UINT256_T,
"prevrandao": UINT256_T,
"prevrandao": BYTES32_T,
"number": UINT256_T,
"gaslimit": UINT256_T,
"basefee": UINT256_T,
Expand Down
Loading