mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Tests and Changelog for basefee.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
contract C {
|
||||
function f() public view returns (uint) {
|
||||
return block.basefee;
|
||||
}
|
||||
function g() public view returns (uint ret) {
|
||||
assembly {
|
||||
ret := basefee()
|
||||
}
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: =berlin
|
||||
// ----
|
||||
// TypeError 5921: (74-87): "basefee" is not supported by the VM version.
|
||||
// TypeError 5430: (183-190): The "basefee" instruction is only available for London-compatible VMs (you are currently compiling for "berlin").
|
||||
@@ -0,0 +1,13 @@
|
||||
contract C {
|
||||
function f() public view returns (uint) {
|
||||
return block.basefee;
|
||||
}
|
||||
function g() public view returns (uint ret) {
|
||||
assembly {
|
||||
ret := basefee()
|
||||
}
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=london
|
||||
// ----
|
||||
@@ -0,0 +1,13 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
assembly { pop(basefee()) }
|
||||
}
|
||||
function g() public pure returns (uint) {
|
||||
return block.basefee;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=london
|
||||
// ----
|
||||
// TypeError 2527: (67-76): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
|
||||
// TypeError 2527: (147-160): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
|
||||
Reference in New Issue
Block a user