Browse Source

add creation transaction

merge

cleanup
cl-refactor
CJentzsch 10 years ago
parent
commit
55b30a4a64
  1. 6
      libevm/VM.cpp
  2. 2
      libevm/VM.h
  3. 2
      libjsqrc/ethereumjs/dist/web3.js.map
  4. 36
      test/libethereum/StateTestsFiller/stSpecialTestFiller.json

6
libevm/VM.cpp

@ -71,7 +71,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps)
for (unsigned i = 0; i < _ext.code.size(); ++i) for (unsigned i = 0; i < _ext.code.size(); ++i)
{ {
if (_ext.code[i] == (byte)Instruction::JUMPDEST) if (_ext.code[i] == (byte)Instruction::JUMPDEST)
m_jumpDests.insert(i); m_jumpDests.push_back(i);
else if (_ext.code[i] >= (byte)Instruction::PUSH1 && _ext.code[i] <= (byte)Instruction::PUSH32) else if (_ext.code[i] >= (byte)Instruction::PUSH1 && _ext.code[i] <= (byte)Instruction::PUSH32)
i += _ext.code[i] - (unsigned)Instruction::PUSH1 + 1; i += _ext.code[i] - (unsigned)Instruction::PUSH1 + 1;
} }
@ -546,7 +546,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps)
break; break;
case Instruction::JUMP: case Instruction::JUMP:
nextPC = m_stack.back(); nextPC = m_stack.back();
if (!m_jumpDests.count(nextPC)) if (find(m_jumpDests.begin(), m_jumpDests.end(), nextPC) == m_jumpDests.end())
BOOST_THROW_EXCEPTION(BadJumpDestination()); BOOST_THROW_EXCEPTION(BadJumpDestination());
m_stack.pop_back(); m_stack.pop_back();
break; break;
@ -554,7 +554,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps)
if (m_stack[m_stack.size() - 2]) if (m_stack[m_stack.size() - 2])
{ {
nextPC = m_stack.back(); nextPC = m_stack.back();
if (!m_jumpDests.count(nextPC)) if (find(m_jumpDests.begin(), m_jumpDests.end(), nextPC) == m_jumpDests.end())
BOOST_THROW_EXCEPTION(BadJumpDestination()); BOOST_THROW_EXCEPTION(BadJumpDestination());
} }
m_stack.pop_back(); m_stack.pop_back();

2
libevm/VM.h

@ -74,7 +74,7 @@ private:
u256 m_curPC = 0; u256 m_curPC = 0;
bytes m_temp; bytes m_temp;
u256s m_stack; u256s m_stack;
std::set<u256> m_jumpDests; std::vector<u256> m_jumpDests;
std::function<void()> m_onFail; std::function<void()> m_onFail;
bigint m_gas = 0; bigint m_gas = 0;
}; };

2
libjsqrc/ethereumjs/dist/web3.js.map

@ -29,7 +29,7 @@
"lib/web3/shh.js", "lib/web3/shh.js",
"lib/web3/watches.js", "lib/web3/watches.js",
"node_modules/browserify/lib/_empty.js", "node_modules/browserify/lib/_empty.js",
"bignumber.js", "node_modules/bignumber.js/bignumber.js",
"index.js" "index.js"
], ],
"names": [], "names": [],

36
test/libethereum/StateTestsFiller/stSpecialTestFiller.json

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save