Skip to content

Commit 0695c9f

Browse files
committed
Temporary files now deleted before new compilation
1 parent 8d3dbda commit 0695c9f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

NEO-Debugger-Core/Utils/DebugManager.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -704,11 +704,23 @@ public bool CompileContract(string sourceCode, SourceLanguage language, string o
704704
Directory.CreateDirectory(_settings.path);
705705
var fileName = Path.Combine(_settings.path, sourceFile);
706706

707+
var avmPath = fileName.Replace(extension, ".avm");
708+
709+
try
710+
{
711+
File.Delete(avmPath.Replace(".avm", ".abi.json"));
712+
File.Delete(avmPath.Replace(".avm", ".debug.json"));
713+
}
714+
catch
715+
{
716+
// ignore
717+
}
718+
707719
bool success = compiler.CompileContract(sourceCode, fileName, language);
708720

709721
if (success)
710722
{
711-
_avmFilePath = fileName.Replace(extension, ".avm");
723+
_avmFilePath = avmPath;
712724

713725
if (outputFile != null)
714726
{

NEO-Emulator/ABI.cs

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public ABI()
2929
{
3030
var f = new AVMFunction();
3131
f.name = "Main";
32+
f.inputs.Add(new AVMInput() { name = "operation", type = Emulator.Type.String});
3233
f.inputs.Add(new AVMInput() { name = "args", type = Emulator.Type.Array });
3334

3435
this.functions[f.name] = f;

0 commit comments

Comments
 (0)