mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-05 09:35:49 +00:00
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:
commit
0968c3a81f
1 changed files with 5 additions and 0 deletions
|
@ -203,6 +203,11 @@ func documentSeqPoints(di *compiler.DebugInfo, doc documentName) []compiler.Debu
|
||||||
}
|
}
|
||||||
|
|
||||||
func addScriptToCoverage(c *Contract) {
|
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()
|
coverageLock.Lock()
|
||||||
defer coverageLock.Unlock()
|
defer coverageLock.Unlock()
|
||||||
if _, ok := rawCoverage[c.Hash]; !ok {
|
if _, ok := rawCoverage[c.Hash]; !ok {
|
||||||
|
|
Loading…
Reference in a new issue