Skip to content

Commit 0968c3a

Browse files
authored
Merge pull request #3600 from nspcc-dev/fix-cover-panic
neotest: don't collect coverage for contracts with empty DI
2 parents 1115193 + 7fac3bc commit 0968c3a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/neotest/coverage.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ func documentSeqPoints(di *compiler.DebugInfo, doc documentName) []compiler.Debu
203203
}
204204

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

0 commit comments

Comments
 (0)