[#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>
This commit is contained in:
parent
1b9c14d5d7
commit
45b28b723b
1 changed files with 0 additions and 8 deletions
|
@ -19,15 +19,8 @@ type ContractWithDebugInfo struct {
|
||||||
DebugInfo *compiler.DebugInfo
|
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.
|
// 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 {
|
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.
|
// nef.NewFile() cares about version a lot.
|
||||||
config.Version = "neotest"
|
config.Version = "neotest"
|
||||||
|
|
||||||
|
@ -56,7 +49,6 @@ func CompileFile(t testing.TB, sender util.Uint160, srcPath string, configPath s
|
||||||
NEF: ne,
|
NEF: ne,
|
||||||
Manifest: m,
|
Manifest: m,
|
||||||
}
|
}
|
||||||
contracts[srcPath] = c
|
|
||||||
return &ContractWithDebugInfo{
|
return &ContractWithDebugInfo{
|
||||||
Contract: c,
|
Contract: c,
|
||||||
DebugInfo: di,
|
DebugInfo: di,
|
||||||
|
|
Loading…
Reference in a new issue