compiler, cli: support events from .yml config file

We currently can't process events in codegen, so we have to provide
them via .yml config file. Do not delete the rest of the code connected
with conversion of MethodDebugInfo.Event into manifest.Event as we have
issue #1038.
This commit is contained in:
Anna Shaleva 2020-08-11 11:21:54 +03:00
parent de8db692f4
commit b5494320f9
6 changed files with 13 additions and 13 deletions

View file

@ -359,8 +359,7 @@ func parsePairJSON(data []byte, sep string) (string, string, error) {
// ConvertToManifest converts contract to the manifest.Manifest struct for debugger.
// Note: manifest is taken from the external source, however it can be generated ad-hoc. See #1038.
func (di *DebugInfo) ConvertToManifest(fs smartcontract.PropertyState, supportedStandards ...string) (*manifest.Manifest, error) {
var err error
func (di *DebugInfo) ConvertToManifest(fs smartcontract.PropertyState, events []manifest.Event, supportedStandards ...string) (*manifest.Manifest, error) {
if di.MainPkg == "" {
return nil, errors.New("no Main method was found")
}
@ -374,19 +373,15 @@ func (di *DebugInfo) ConvertToManifest(fs smartcontract.PropertyState, supported
methods = append(methods, mMethod)
}
}
events := make([]manifest.Event, len(di.Events))
for i, event := range di.Events {
events[i], err = event.ToManifestEvent()
if err != nil {
return nil, err
}
}
result := manifest.NewManifest(di.Hash)
result.Features = fs
if supportedStandards != nil {
result.SupportedStandards = supportedStandards
}
if events == nil {
events = make([]manifest.Event, 0)
}
result.ABI = manifest.ABI{
Hash: di.Hash,
Methods: methods,