Merge pull request #3600 from nspcc-dev/fix-cover-panic

neotest: don't collect coverage for contracts with empty DI
This commit is contained in:
Roman Khimov 2024-10-07 19:15:39 +03:00 committed by GitHub
commit 0968c3a81f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {