[#3] Remove unnecessary caching in CompileFile

At this stage there is no need for such optimization

Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
master
Ekaterina Lebedeva 2023-08-01 16:04:18 +03:00
parent 1b9c14d5d7
commit 45b28b723b
1 changed files with 0 additions and 8 deletions

View File

@ -19,15 +19,8 @@ type ContractWithDebugInfo struct {
DebugInfo *compiler.DebugInfo
}
// contracts caches the compiled contracts from FS across multiple tests.
var contracts = make(map[string]*neotest.Contract)
// CompileFile compiles a contract from the file and returns its NEF, manifest, hash and debug information.
func CompileFile(t testing.TB, sender util.Uint160, srcPath string, configPath string) *ContractWithDebugInfo {
if c, ok := contracts[srcPath]; ok {
return c
}
// nef.NewFile() cares about version a lot.
config.Version = "neotest"
@ -56,7 +49,6 @@ func CompileFile(t testing.TB, sender util.Uint160, srcPath string, configPath s
NEF: ne,
Manifest: m,
}
contracts[srcPath] = c
return &ContractWithDebugInfo{
Contract: c,
DebugInfo: di,