Skip to content

Commit

Permalink
remove scriptHash type
Browse files Browse the repository at this point in the history
  • Loading branch information
Slava0135 committed Jul 3, 2024
1 parent 2176091 commit 324b150
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/neotest/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
8 changes: 3 additions & 5 deletions pkg/neotest/coverage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 324b150

Please sign in to comment.