Added EVMVersion london.

Also set the value of `block_base_fee` for testing to 7 wei.
This commit is contained in:
hrkrshnn
2021-08-09 16:18:08 +02:00
parent 543ccf5287
commit af1dabb555
3 changed files with 10 additions and 3 deletions
+5 -2
View File
@@ -51,10 +51,11 @@ public:
static EVMVersion petersburg() { return {Version::Petersburg}; }
static EVMVersion istanbul() { return {Version::Istanbul}; }
static EVMVersion berlin() { return {Version::Berlin}; }
static EVMVersion london() { return {Version::London}; }
static std::optional<EVMVersion> fromString(std::string const& _version)
{
for (auto const& v: {homestead(), tangerineWhistle(), spuriousDragon(), byzantium(), constantinople(), petersburg(), istanbul(), berlin()})
for (auto const& v: {homestead(), tangerineWhistle(), spuriousDragon(), byzantium(), constantinople(), petersburg(), istanbul(), berlin(), london()})
if (_version == v.name())
return v;
return std::nullopt;
@@ -75,6 +76,7 @@ public:
case Version::Petersburg: return "petersburg";
case Version::Istanbul: return "istanbul";
case Version::Berlin: return "berlin";
case Version::London: return "london";
}
return "INVALID";
}
@@ -87,6 +89,7 @@ public:
bool hasExtCodeHash() const { return *this >= constantinople(); }
bool hasChainID() const { return *this >= istanbul(); }
bool hasSelfBalance() const { return *this >= istanbul(); }
bool hasBaseFee() const { return *this >= london(); }
bool hasOpcode(evmasm::Instruction _opcode) const;
@@ -95,7 +98,7 @@ public:
bool canOverchargeGasForCall() const { return *this >= tangerineWhistle(); }
private:
enum class Version { Homestead, TangerineWhistle, SpuriousDragon, Byzantium, Constantinople, Petersburg, Istanbul, Berlin };
enum class Version { Homestead, TangerineWhistle, SpuriousDragon, Byzantium, Constantinople, Petersburg, Istanbul, Berlin, London };
EVMVersion(Version _version): m_version(_version) {}