From adb5a6869f8a843561641f28c879420b4b166400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Fri, 5 Dec 2014 08:43:34 +0100 Subject: [PATCH] A bit of work in evmcc. Not ready yet. --- evmcc/evmcc.cpp | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/evmcc/evmcc.cpp b/evmcc/evmcc.cpp index 16ab23e9be..3a72bb4f33 100644 --- a/evmcc/evmcc.cpp +++ b/evmcc/evmcc.cpp @@ -16,8 +16,8 @@ #include #include #include -#include -#include +#include +#include void parseProgramOptions(int _argc, char** _argv, boost::program_options::variables_map& _varMap) @@ -97,7 +97,7 @@ int main(int argc, char** argv) } std::string src((std::istreambuf_iterator(ifs)), - (std::istreambuf_iterator())); + (std::istreambuf_iterator())); boost::algorithm::trim(src); @@ -165,8 +165,8 @@ int main(int argc, char** argv) if (options.count("verbose")) { std::cerr << "*** Compilation time: " - << std::chrono::duration_cast(compilationEndTime - compilationStartTime).count() - << std::endl; + << std::chrono::duration_cast(compilationEndTime - compilationStartTime).count() + << std::endl; } if (options.count("interpret")) @@ -174,23 +174,24 @@ int main(int argc, char** argv) auto engine = eth::jit::ExecutionEngine(); u256 gas = initialGas; - // Create fake ExtVM interface - eth::ExtVMFace ext; - ext.myAddress = Address(1122334455667788); - ext.caller = Address(0xfacefacefaceface); - ext.origin = Address(101010101010101010); - ext.value = 0xabcd; - ext.gasPrice = 1002; - ext.previousBlock.hash = u256(1003); - ext.currentBlock.coinbaseAddress = Address(1004); - ext.currentBlock.timestamp = 1005; - ext.currentBlock.number = 1006; - ext.currentBlock.difficulty = 1007; - ext.currentBlock.gasLimit = 1008; - ext.data = std::string("Hello the Beautiful World of Ethereum!"); - ext.code = { 0x0d, 0x0e, 0x0a, 0x0d, 0x0b, 0x0e, 0xe, 0xf }; + // Create fake ExtVM interface + eth::ExtVMFace ext; + ext.myAddress = Address(1122334455667788); + ext.caller = Address(0xfacefacefaceface); + ext.origin = Address(101010101010101010); + ext.value = 0xabcd; + ext.gasPrice = 1002; + ext.previousBlock.hash = u256(1003); + ext.currentBlock.coinbaseAddress = Address(1004); + ext.currentBlock.timestamp = 1005; + ext.currentBlock.number = 1006; + ext.currentBlock.difficulty = 1007; + ext.currentBlock.gasLimit = 1008; + ext.data = std::string("Hello the Beautiful World of Ethereum!"); + ext.code = { 0x0d, 0x0e, 0x0a, 0x0d, 0x0b, 0x0e, 0xe, 0xf }; - auto result = engine.run(std::move(module), gas, options.count("show-logs") > 0, ext); + // BROKEN: env_* functions must be implemented & RuntimeData struct created + auto result = engine.run(std::move(module), gas, ext); return result; } }