From 0695c9f226d18e4c90b905134941ecde2548619b Mon Sep 17 00:00:00 2001 From: Relfos Date: Sun, 1 Apr 2018 12:34:16 +0100 Subject: [PATCH] Temporary files now deleted before new compilation --- NEO-Debugger-Core/Utils/DebugManager.cs | 14 +++++++++++++- NEO-Emulator/ABI.cs | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/NEO-Debugger-Core/Utils/DebugManager.cs b/NEO-Debugger-Core/Utils/DebugManager.cs index 88cc2d7..124fbc8 100644 --- a/NEO-Debugger-Core/Utils/DebugManager.cs +++ b/NEO-Debugger-Core/Utils/DebugManager.cs @@ -704,11 +704,23 @@ public bool CompileContract(string sourceCode, SourceLanguage language, string o Directory.CreateDirectory(_settings.path); var fileName = Path.Combine(_settings.path, sourceFile); + var avmPath = fileName.Replace(extension, ".avm"); + + try + { + File.Delete(avmPath.Replace(".avm", ".abi.json")); + File.Delete(avmPath.Replace(".avm", ".debug.json")); + } + catch + { + // ignore + } + bool success = compiler.CompileContract(sourceCode, fileName, language); if (success) { - _avmFilePath = fileName.Replace(extension, ".avm"); + _avmFilePath = avmPath; if (outputFile != null) { diff --git a/NEO-Emulator/ABI.cs b/NEO-Emulator/ABI.cs index 0d43706..983496f 100644 --- a/NEO-Emulator/ABI.cs +++ b/NEO-Emulator/ABI.cs @@ -29,6 +29,7 @@ public ABI() { var f = new AVMFunction(); f.name = "Main"; + f.inputs.Add(new AVMInput() { name = "operation", type = Emulator.Type.String}); f.inputs.Add(new AVMInput() { name = "args", type = Emulator.Type.Array }); this.functions[f.name] = f;