Merge pull request #204 from ethereum/hot_gav

The Big Refactor
This commit is contained in:
Gav Wood 2015-11-19 12:20:46 +01:00
commit 3be0ae6e2c
3 changed files with 7 additions and 4 deletions

View File

@ -276,8 +276,10 @@ void CompilerUtils::memoryCopy()
m_context << u256(0) << u256(identityContractAddress); m_context << u256(0) << u256(identityContractAddress);
// compute gas costs // compute gas costs
m_context << u256(32) << eth::Instruction::DUP5 << u256(31) << eth::Instruction::ADD; m_context << u256(32) << eth::Instruction::DUP5 << u256(31) << eth::Instruction::ADD;
m_context << eth::Instruction::DIV << u256(eth::c_identityWordGas) << eth::Instruction::MUL; static unsigned c_identityGas = 3;
m_context << u256(eth::c_identityGas) << eth::Instruction::ADD; static unsigned c_identityWordGas = 15;
m_context << eth::Instruction::DIV << u256(c_identityWordGas) << eth::Instruction::MUL;
m_context << u256(c_identityGas) << eth::Instruction::ADD;
m_context << eth::Instruction::CALL; m_context << eth::Instruction::CALL;
m_context << eth::Instruction::POP; // ignore return value m_context << eth::Instruction::POP; // ignore return value
} }

View File

@ -1151,7 +1151,7 @@ BOOST_AUTO_TEST_CASE(blockchain)
" blockNumber = block.number;\n" " blockNumber = block.number;\n"
" }\n" " }\n"
"}\n"; "}\n";
m_envInfo.setBeneficiary(Address(0x123)); m_envInfo.setAuthor(Address(0x123));
m_envInfo.setNumber(7); m_envInfo.setNumber(7);
compileAndRun(sourceCode, 27); compileAndRun(sourceCode, 27);
BOOST_CHECK(callContractFunctionWithValue("someInfo()", 28) == encodeArgs(28, 0x123, 7)); BOOST_CHECK(callContractFunctionWithValue("someInfo()", 28) == encodeArgs(28, 0x123, 7));

View File

@ -42,7 +42,8 @@ namespace test
class ExecutionFramework class ExecutionFramework
{ {
public: public:
ExecutionFramework() ExecutionFramework():
m_state(0)
{ {
if (g_logVerbosity != -1) if (g_logVerbosity != -1)
g_logVerbosity = 0; g_logVerbosity = 0;