MCPcopy Create free account
hub / github.com/LUX-Core/lux / writeVMlog

Function writeVMlog

src/main.cpp:7827–7852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7825}
7826
7827void 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
7854bool ByteCodeExec::performByteCode(dev::eth::Permanence type){
7855 for(LuxTransaction& tx : txs){

Callers 2

callcontractFunction · 0.85
ConnectBlockFunction · 0.85

Calls 5

vmLogToJSONFunction · 0.85
strMethod · 0.80
closeMethod · 0.45
sizeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected