mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Support petersburg in evmVersion
This commit is contained in:
committed by
chriseth
parent
68e1bf47d5
commit
ecd246aeb6
@@ -30,7 +30,7 @@ namespace langutil
|
||||
|
||||
/**
|
||||
* A version specifier of the EVM we want to compile to.
|
||||
* Defaults to the latest version.
|
||||
* Defaults to the latest version deployed on Ethereum mainnet at the time of compiler release.
|
||||
*/
|
||||
class EVMVersion:
|
||||
boost::less_than_comparable<EVMVersion>,
|
||||
@@ -44,10 +44,11 @@ public:
|
||||
static EVMVersion spuriousDragon() { return {Version::SpuriousDragon}; }
|
||||
static EVMVersion byzantium() { return {Version::Byzantium}; }
|
||||
static EVMVersion constantinople() { return {Version::Constantinople}; }
|
||||
static EVMVersion petersburg() { return {Version::Petersburg}; }
|
||||
|
||||
static boost::optional<EVMVersion> fromString(std::string const& _version)
|
||||
{
|
||||
for (auto const& v: {homestead(), tangerineWhistle(), spuriousDragon(), byzantium(), constantinople()})
|
||||
for (auto const& v: {homestead(), tangerineWhistle(), spuriousDragon(), byzantium(), constantinople(), petersburg()})
|
||||
if (_version == v.name())
|
||||
return v;
|
||||
return {};
|
||||
@@ -65,6 +66,7 @@ public:
|
||||
case Version::SpuriousDragon: return "spuriousDragon";
|
||||
case Version::Byzantium: return "byzantium";
|
||||
case Version::Constantinople: return "constantinople";
|
||||
case Version::Petersburg: return "petersburg";
|
||||
}
|
||||
return "INVALID";
|
||||
}
|
||||
@@ -81,7 +83,7 @@ public:
|
||||
bool canOverchargeGasForCall() const { return *this >= tangerineWhistle(); }
|
||||
|
||||
private:
|
||||
enum class Version { Homestead, TangerineWhistle, SpuriousDragon, Byzantium, Constantinople };
|
||||
enum class Version { Homestead, TangerineWhistle, SpuriousDragon, Byzantium, Constantinople, Petersburg };
|
||||
|
||||
EVMVersion(Version _version): m_version(_version) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user