From 6cc3d9bcc3c4111aee8365cc3857b210b24979bf Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 24 Jun 2020 08:55:24 +0300 Subject: [PATCH] compiler: remove entrypoint from debug info part of #1088 --- pkg/compiler/debug.go | 18 ++++++++---------- pkg/compiler/debug_test.go | 5 ++--- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/pkg/compiler/debug.go b/pkg/compiler/debug.go index db72ea611..96fdebcbe 100644 --- a/pkg/compiler/debug.go +++ b/pkg/compiler/debug.go @@ -16,11 +16,10 @@ import ( // DebugInfo represents smart-contract debug information. type DebugInfo struct { - Hash util.Uint160 `json:"hash"` - EntryPoint string `json:"entrypoint"` - Documents []string `json:"documents"` - Methods []MethodDebugInfo `json:"methods"` - Events []EventDebugInfo `json:"events"` + Hash util.Uint160 `json:"hash"` + Documents []string `json:"documents"` + Methods []MethodDebugInfo `json:"methods"` + Events []EventDebugInfo `json:"events"` } // MethodDebugInfo represents smart-contract's method debug information. @@ -134,9 +133,8 @@ func (c *codegen) saveSequencePoint(n ast.Node) { func (c *codegen) emitDebugInfo(contract []byte) *DebugInfo { d := &DebugInfo{ - Hash: hash.Hash160(contract), - EntryPoint: mainIdent, - Events: []EventDebugInfo{}, + Hash: hash.Hash160(contract), + Events: []EventDebugInfo{}, } for name, scope := range c.funcs { m := c.methodInfoFromScope(name, scope) @@ -318,7 +316,7 @@ func parsePairJSON(data []byte, sep string) (string, string, error) { func (di *DebugInfo) convertToABI(fs smartcontract.PropertyState) ABI { methods := make([]Method, 0) for _, method := range di.Methods { - if method.Name.Name == di.EntryPoint { + if method.Name.Name == mainIdent { methods = append(methods, Method{ Name: method.Name.Name, Parameters: method.Parameters, @@ -340,7 +338,7 @@ func (di *DebugInfo) convertToABI(fs smartcontract.PropertyState) ABI { HasStorage: fs&smartcontract.HasStorage != 0, IsPayable: fs&smartcontract.IsPayable != 0, }, - EntryPoint: di.EntryPoint, + EntryPoint: mainIdent, Functions: methods, Events: events, } diff --git a/pkg/compiler/debug_test.go b/pkg/compiler/debug_test.go index a277d451d..0c0acc70d 100644 --- a/pkg/compiler/debug_test.go +++ b/pkg/compiler/debug_test.go @@ -178,9 +178,8 @@ func TestSequencePoints(t *testing.T) { func TestDebugInfo_MarshalJSON(t *testing.T) { d := &DebugInfo{ - Hash: util.Uint160{10, 11, 12, 13}, - EntryPoint: "main", - Documents: []string{"/path/to/file"}, + Hash: util.Uint160{10, 11, 12, 13}, + Documents: []string{"/path/to/file"}, Methods: []MethodDebugInfo{ { ID: "id1",