Skip to content

Commit

Permalink
Merge pull request #3600 from nspcc-dev/fix-cover-panic
Browse files Browse the repository at this point in the history
neotest: don't collect coverage for contracts with empty DI
  • Loading branch information
roman-khimov authored Oct 7, 2024
2 parents 1115193 + 7fac3bc commit 0968c3a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/neotest/coverage.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ func documentSeqPoints(di *compiler.DebugInfo, doc documentName) []compiler.Debu
}

func addScriptToCoverage(c *Contract) {
// Any garbage may be passed to deployment methods, filter out useless contracts
// to avoid misleading behaviour during coverage collection.
if c.DebugInfo == nil || c.Hash.Equals(util.Uint160{}) {
return
}
coverageLock.Lock()
defer coverageLock.Unlock()
if _, ok := rawCoverage[c.Hash]; !ok {
Expand Down

0 comments on commit 0968c3a

Please sign in to comment.