|
@ -25,18 +25,17 @@ |
|
|
#include <libdevcore/Log.h> |
|
|
#include <libdevcore/Log.h> |
|
|
#include <libevmcore/Instruction.h> |
|
|
#include <libevmcore/Instruction.h> |
|
|
#include <libethcore/CommonEth.h> |
|
|
#include <libethcore/CommonEth.h> |
|
|
#include <libevm/ExtVMFace.h> |
|
|
#include <libevm/VMFace.h> |
|
|
#include "Transaction.h" |
|
|
#include "Transaction.h" |
|
|
#include "Manifest.h" |
|
|
#include "ExtVM.h" |
|
|
|
|
|
|
|
|
namespace dev |
|
|
namespace dev |
|
|
{ |
|
|
{ |
|
|
namespace eth |
|
|
namespace eth |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
class VM; |
|
|
|
|
|
class ExtVM; |
|
|
|
|
|
class State; |
|
|
class State; |
|
|
|
|
|
struct Manifest; |
|
|
|
|
|
|
|
|
struct VMTraceChannel: public LogChannel { static const char* name() { return "EVM"; } static const int verbosity = 11; }; |
|
|
struct VMTraceChannel: public LogChannel { static const char* name() { return "EVM"; } static const int verbosity = 11; }; |
|
|
|
|
|
|
|
@ -44,7 +43,9 @@ class Executive |
|
|
{ |
|
|
{ |
|
|
public: |
|
|
public: |
|
|
Executive(State& _s, Manifest* o_ms = nullptr): m_s(_s), m_ms(o_ms) {} |
|
|
Executive(State& _s, Manifest* o_ms = nullptr): m_s(_s), m_ms(o_ms) {} |
|
|
~Executive(); |
|
|
~Executive() = default; |
|
|
|
|
|
Executive(Executive const&) = delete; |
|
|
|
|
|
void operator=(Executive) = delete; |
|
|
|
|
|
|
|
|
bool setup(bytesConstRef _transaction); |
|
|
bool setup(bytesConstRef _transaction); |
|
|
bool create(Address _txSender, u256 _endowment, u256 _gasPrice, u256 _gas, bytesConstRef _code, Address _originAddress); |
|
|
bool create(Address _txSender, u256 _endowment, u256 _gasPrice, u256 _gas, bytesConstRef _code, Address _originAddress); |
|
@ -63,14 +64,14 @@ public: |
|
|
h160 newAddress() const { return m_newAddress; } |
|
|
h160 newAddress() const { return m_newAddress; } |
|
|
LogEntries const& logs() const { return m_logs; } |
|
|
LogEntries const& logs() const { return m_logs; } |
|
|
|
|
|
|
|
|
VM const& vm() const { return *m_vm; } |
|
|
VMFace const& vm() const { return *m_vm; } |
|
|
State const& state() const { return m_s; } |
|
|
State const& state() const { return m_s; } |
|
|
ExtVM const& ext() const { return *m_ext; } |
|
|
ExtVM const& ext() const { return *m_ext; } |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
State& m_s; |
|
|
State& m_s; |
|
|
ExtVM* m_ext = nullptr; // TODO: make safe.
|
|
|
std::unique_ptr<ExtVM> m_ext; |
|
|
VM* m_vm = nullptr; |
|
|
std::unique_ptr<VMFace> m_vm; |
|
|
Manifest* m_ms = nullptr; |
|
|
Manifest* m_ms = nullptr; |
|
|
bytesConstRef m_out; |
|
|
bytesConstRef m_out; |
|
|
Address m_newAddress; |
|
|
Address m_newAddress; |
|
|