From f37831d17389508ccd238f404f19d40f77ca8255 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 7 Jul 2020 13:42:15 +0300 Subject: [PATCH] compiler: convert to manifest only methods from main pkg manifest.json should contain only methods from the package where `Main` function located. --- pkg/compiler/debug.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/compiler/debug.go b/pkg/compiler/debug.go index fd4752101..69af761e3 100644 --- a/pkg/compiler/debug.go +++ b/pkg/compiler/debug.go @@ -341,8 +341,9 @@ func parsePairJSON(data []byte, sep string) (string, string, error) { // Note: manifest is taken from the external source, however it can be generated ad-hoc. See #1038. func (di *DebugInfo) convertToManifest(fs smartcontract.PropertyState) (*manifest.Manifest, error) { var ( - entryPoint manifest.Method - err error + entryPoint manifest.Method + mainNamespace string + err error ) for _, method := range di.Methods { if method.Name.Name == mainIdent { @@ -350,6 +351,7 @@ func (di *DebugInfo) convertToManifest(fs smartcontract.PropertyState) (*manifes if err != nil { return nil, err } + mainNamespace = method.Name.Namespace break } } @@ -358,7 +360,7 @@ func (di *DebugInfo) convertToManifest(fs smartcontract.PropertyState) (*manifes } methods := make([]manifest.Method, 0) for _, method := range di.Methods { - if method.Name.Name != mainIdent && method.IsExported { + if method.Name.Name != mainIdent && method.IsExported && method.Name.Namespace == mainNamespace { mMethod, err := method.ToManifestMethod() if err != nil { return nil, err