Merge pull request #236 from ethereum/hot_gav

Fix up for new API from EIP-1.1.
This commit is contained in:
Gav Wood
2015-11-23 12:42:28 +01:00
6 changed files with 18 additions and 15 deletions
+3 -1
View File
@@ -59,12 +59,14 @@ public:
void testCreationTimeGas(string const& _sourceCode)
{
EVMSchedule schedule;// TODO: make relevant to supposed context.
compileAndRun(_sourceCode);
auto state = make_shared<KnownState>();
PathGasMeter meter(*m_compiler.assemblyItems());
GasMeter::GasConsumption gas = meter.estimateMax(0, state);
u256 bytecodeSize(m_compiler.runtimeObject().bytecode.size());
gas += bytecodeSize * c_createDataGas;
gas += bytecodeSize * schedule.createDataGas;
BOOST_REQUIRE(!gas.isInfinite);
BOOST_CHECK(gas.value == m_gasUsed);
}