Renames & comments

This commit is contained in:
Paweł Bylica 2014-10-10 17:17:45 +02:00
parent ad43b92d97
commit d6915b4d0b

View file

@ -49,7 +49,7 @@ uint64_t getStepCost(dev::eth::Instruction inst) // TODO: Add this function to F
}
}
bool isCommitTrigger(Instruction _inst)
bool isCostBlockEnd(Instruction _inst)
{
switch (_inst)
{
@ -101,17 +101,16 @@ void GasMeter::check(Instruction _inst)
{
if (!m_checkCall)
{
// Create gas check call with mocked block cost at begining of current cost-block
m_checkCall = m_builder.CreateCall(m_gasCheckFunc, m_builder.getIntN(256, 0));
}
auto stepCost = getStepCost(_inst);
m_blockCost += stepCost;
m_blockCost += getStepCost(_inst);
auto isTrigger = isCommitTrigger(_inst);
if (isTrigger)
if (isCostBlockEnd(_inst))
{
m_checkCall->setArgOperand(0, m_builder.getIntN(256, m_blockCost));
m_checkCall = nullptr;
m_checkCall->setArgOperand(0, m_builder.getIntN(256, m_blockCost)); // Update block cost in gas check call
m_checkCall = nullptr; // End cost-block
}
}