remove scriptHash type
This commit is contained in:
parent
dd9a0c56f1
commit
14f867564d
2 changed files with 4 additions and 6 deletions
|
@ -89,7 +89,7 @@ func CompileFile(t testing.TB, sender util.Uint160, srcPath string, configPath s
|
|||
return c
|
||||
}
|
||||
|
||||
func collectCoverage(t testing.TB, di *compiler.DebugInfo, h scriptHash) {
|
||||
func collectCoverage(t testing.TB, di *compiler.DebugInfo, h util.Uint160) {
|
||||
if isCoverageEnabled() {
|
||||
if _, ok := rawCoverage[h]; !ok {
|
||||
rawCoverage[h] = &scriptRawCoverage{debugInfo: di}
|
||||
|
|
|
@ -12,13 +12,11 @@ import (
|
|||
"github.com/nspcc-dev/neo-go/pkg/vm/opcode"
|
||||
)
|
||||
|
||||
var rawCoverage = make(map[scriptHash]*scriptRawCoverage)
|
||||
var rawCoverage = make(map[util.Uint160]*scriptRawCoverage)
|
||||
|
||||
var enabled bool
|
||||
var coverProfile = ""
|
||||
|
||||
type scriptHash = util.Uint160
|
||||
|
||||
type scriptRawCoverage struct {
|
||||
debugInfo *compiler.DebugInfo
|
||||
offsetsVisited []int
|
||||
|
@ -55,8 +53,8 @@ func isCoverageEnabled() bool {
|
|||
}
|
||||
|
||||
func coverageHook() vm.OnExecHook {
|
||||
return func(sh scriptHash, offset int, opcode opcode.Opcode) {
|
||||
if cov, ok := rawCoverage[sh]; ok {
|
||||
return func(scriptHash util.Uint160, offset int, opcode opcode.Opcode) {
|
||||
if cov, ok := rawCoverage[scriptHash]; ok {
|
||||
cov.offsetsVisited = append(cov.offsetsVisited, offset)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue