diff --git a/neth/main.cpp b/neth/main.cpp index 4c38da0a4..31df2ffcb 100644 --- a/neth/main.cpp +++ b/neth/main.cpp @@ -626,6 +626,7 @@ int main(int argc, char** argv) logwin = newwin(height * 2 / 5 - 2, width * 2 / 3, qheight, 0); nc::nc_window_streambuf outbuf(logwin, std::cout); + nc::nc_window_streambuf eoutbuf(logwin, std::cerr); consolewin = newwin(qheight, width / 4, 0, 0); nc::nc_window_streambuf coutbuf(consolewin, ccout); diff --git a/solc/docker_emscripten/Dockerfile b/solc/docker_emscripten/Dockerfile index 06467a2c5..1ad1875d7 100644 --- a/solc/docker_emscripten/Dockerfile +++ b/solc/docker_emscripten/Dockerfile @@ -43,7 +43,14 @@ RUN sed -i 's/$(archiver\[1\])/\/home\/user\/emsdk_portable\/emscripten\/master\ RUN sed -i 's/$(ranlib\[1\])/\/home\/user\/emsdk_portable\/emscripten\/master\/emranlib/g' ./tools/build/src/tools/gcc.jam RUN ./b2 link=static variant=release threading=single runtime-link=static thread system regex -# Build soljs +# Json-CPP +WORKDIR /home/user +RUN git clone https://github.com/open-source-parsers/jsoncpp.git +WORKDIR /home/user/jsoncpp +RUN emcmake cmake -DJSONCPP_LIB_BUILD_STATIC=ON -DJSONCPP_LIB_BUILD_SHARED=OFF -DJSONCPP_WITH_TESTS=OFF -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF -G "Unix Makefiles" . +RUN emmake make + +## Build soljs WORKDIR /home/user ADD https://api.github.com/repos/ethereum/cpp-ethereum/git/refs/heads/develop unused.txt RUN git clone --depth=1 https://github.com/ethereum/cpp-ethereum @@ -55,8 +62,10 @@ RUN git remote add -f solidityjs https://github.com/chriseth/cpp-ethereum # TODO this should be a proper merge but somehow causes problems # NOTE that we only get the latest commit of that branch RUN git cherry-pick solidityjs/solidity-js -RUN emcmake cmake -DETH_STATIC=1 -DONLY_SOLIDITY=1 -DHEADLESS=1 -DCMAKE_CXX_COMPILER=/home/user/emsdk_portable/emscripten/master/em++ -DCMAKE_C_COMPILER=/home/user/emsdk_portable/emscripten/master/emcc +RUN emcmake cmake -DETH_STATIC=1 -DSOLIDITY=ON -DGUI=0 -DCMAKE_CXX_COMPILER=/home/user/emsdk_portable/emscripten/master/em++ -DCMAKE_C_COMPILER=/home/user/emsdk_portable/emscripten/master/emcc RUN emmake make -j 6 soljs -ENTRYPOINT cat soljs/soljs.js +WORKDIR /home/user/cpp-ethereum/soljs +# somehow it does not work to pipe out both files +#ENTRYPOINT tar -c soljs.js soljs.js.mem | base64 diff --git a/test/TestHelper.cpp b/test/TestHelper.cpp index 92a8258ac..ed844e961 100644 --- a/test/TestHelper.cpp +++ b/test/TestHelper.cpp @@ -123,7 +123,7 @@ json_spirit::mObject& ImportTest::makeAllFieldsHex(json_spirit::mObject& _o) { static const set hashes {"bloom" , "coinbase", "hash", "mixHash", "parentHash", "receiptTrie", "stateRoot", "transactionsTrie", "uncleHash", "currentCoinbase", - "previousHash", "to", "address", "caller", "origin", "secretKey"}; + "previousHash", "to", "address", "caller", "origin", "secretKey", "data"}; for (auto& i: _o) { @@ -140,7 +140,7 @@ json_spirit::mObject& ImportTest::makeAllFieldsHex(json_spirit::mObject& _o) str = value.get_str(); else continue; - _o[key] = (str.substr(0, 2) == "0x") ? str : "0x" + toHex(toCompactBigEndian(toInt(str))); + _o[key] = (str.substr(0, 2) == "0x") ? str : "0x" + toHex(toCompactBigEndian(toInt(str), 1)); } return _o; } @@ -363,8 +363,8 @@ json_spirit::mObject fillJsonWithState(State _state) for (auto const& a: _state.addresses()) { json_spirit::mObject o; - o["balance"] = "0x" + toHex(toCompactBigEndian(_state.balance(a.first))); - o["nonce"] = "0x" + toHex(toCompactBigEndian(_state.transactionsFrom(a.first))); + o["balance"] = "0x" + toHex(toCompactBigEndian(_state.balance(a.first), 1)); + o["nonce"] = "0x" + toHex(toCompactBigEndian(_state.transactionsFrom(a.first), 1)); { json_spirit::mObject store; for (auto const& s: _state.storage(a.first)) diff --git a/test/blockchain.cpp b/test/blockchain.cpp index b144abe62..ec8fb7539 100644 --- a/test/blockchain.cpp +++ b/test/blockchain.cpp @@ -625,11 +625,11 @@ void writeBlockHeaderToJson(mObject& _o, BlockInfo const& _bi) _o["transactionsTrie"] = toString(_bi.transactionsRoot); _o["receiptTrie"] = toString(_bi.receiptsRoot); _o["bloom"] = toString(_bi.logBloom); - _o["difficulty"] = "0x" + toHex(toCompactBigEndian(_bi.difficulty)); - _o["number"] = "0x" + toHex(toCompactBigEndian(_bi.number)); - _o["gasLimit"] = "0x" + toHex(toCompactBigEndian(_bi.gasLimit)); - _o["gasUsed"] = "0x" + toHex(toCompactBigEndian(_bi.gasUsed)); - _o["timestamp"] = "0x" + toHex(toCompactBigEndian(_bi.timestamp)); + _o["difficulty"] = "0x" + toHex(toCompactBigEndian(_bi.difficulty), 1); + _o["number"] = "0x" + toHex(toCompactBigEndian(_bi.number), 1); + _o["gasLimit"] = "0x" + toHex(toCompactBigEndian(_bi.gasLimit), 1); + _o["gasUsed"] = "0x" + toHex(toCompactBigEndian(_bi.gasUsed), 1); + _o["timestamp"] = "0x" + toHex(toCompactBigEndian(_bi.timestamp), 1); _o["extraData"] ="0x" + toHex(_bi.extraData); _o["mixHash"] = toString(_bi.mixHash); _o["nonce"] = toString(_bi.nonce);