compiler: check emitted event names

Check that all `Notify` invocations in source correspond to some event
in manifest.
Helpful for typos such as `transfer` instead of `Transfer`.
This commit is contained in:
Evgenii Stratonikov 2020-11-24 16:36:35 +03:00
parent 25f1db6de0
commit 75a9a42403
15 changed files with 172 additions and 7 deletions

View file

@ -24,6 +24,8 @@ type DebugInfo struct {
Documents []string `json:"documents"`
Methods []MethodDebugInfo `json:"methods"`
Events []EventDebugInfo `json:"events"`
// EmittedEvents contains events occuring in code.
EmittedEvents map[string][][]string `json:"-"`
}
// MethodDebugInfo represents smart-contract's method debug information.
@ -162,6 +164,7 @@ func (c *codegen) emitDebugInfo(contract []byte) *DebugInfo {
}
d.Methods = append(d.Methods, *m)
}
d.EmittedEvents = c.emittedEvents
return d
}