| 7825 | } |
| 7826 | |
| 7827 | void writeVMlog(const std::vector<ResultExecute>& res, const CTransaction& tx, const CBlock& block){ |
| 7828 | boost::filesystem::path luxDir = GetDataDir() / "vmExecLogs.json"; |
| 7829 | std::stringstream ss; |
| 7830 | if(fIsVMlogFile){ |
| 7831 | ss << ","; |
| 7832 | } else { |
| 7833 | std::ofstream file(luxDir.string(), std::ios::out | std::ios::app); |
| 7834 | file << "{\"logs\":[]}"; |
| 7835 | file.close(); |
| 7836 | } |
| 7837 | |
| 7838 | for(size_t i = 0; i < res.size(); i++){ |
| 7839 | ss << vmLogToJSON(res[i], tx, block).write(); |
| 7840 | if(i != res.size() - 1){ |
| 7841 | ss << ","; |
| 7842 | } else { |
| 7843 | ss << "]}"; |
| 7844 | } |
| 7845 | } |
| 7846 | |
| 7847 | std::ofstream file(luxDir.string(), std::ios::in | std::ios::out); |
| 7848 | file.seekp(-2, std::ios::end); |
| 7849 | file << ss.str(); |
| 7850 | file.close(); |
| 7851 | fIsVMlogFile = true; |
| 7852 | } |
| 7853 | |
| 7854 | bool ByteCodeExec::performByteCode(dev::eth::Permanence type){ |
| 7855 | for(LuxTransaction& tx : txs){ |
no test coverage detected