mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 19:42:23 +00:00
compiler: add events to debuginfo from .yml config
This commit is contained in:
parent
bcb7b9ba63
commit
44aefe76b4
1 changed files with 15 additions and 0 deletions
|
@ -184,6 +184,21 @@ func CompileAndSave(src string, o *Options) ([]byte, error) {
|
|||
}
|
||||
|
||||
if o.DebugInfo != "" {
|
||||
di.Events = make([]EventDebugInfo, len(o.ContractEvents))
|
||||
for i, e := range o.ContractEvents {
|
||||
params := make([]DebugParam, len(e.Parameters))
|
||||
for j, p := range e.Parameters {
|
||||
params[j] = DebugParam{
|
||||
Name: p.Name,
|
||||
Type: p.Type.String(),
|
||||
}
|
||||
}
|
||||
di.Events[i] = EventDebugInfo{
|
||||
ID: e.Name,
|
||||
Name: e.Name,
|
||||
Parameters: params,
|
||||
}
|
||||
}
|
||||
data, err := json.Marshal(di)
|
||||
if err != nil {
|
||||
return b, err
|
||||
|
|
Loading…
Reference in a new issue