From e390981747933db03a1e7a508f44a1ba2a0685b9 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 6 Apr 2022 15:27:01 +0300 Subject: [PATCH] compiler: add hash field to debug info New debugger won't work without it. --- pkg/compiler/debug.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/compiler/debug.go b/pkg/compiler/debug.go index 2389ba524..e6b16bcc5 100644 --- a/pkg/compiler/debug.go +++ b/pkg/compiler/debug.go @@ -12,6 +12,7 @@ import ( "unicode" "unicode/utf8" + "github.com/nspcc-dev/neo-go/pkg/crypto/hash" "github.com/nspcc-dev/neo-go/pkg/smartcontract" "github.com/nspcc-dev/neo-go/pkg/smartcontract/binding" "github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest" @@ -22,6 +23,7 @@ import ( // DebugInfo represents smart-contract debug information. type DebugInfo struct { MainPkg string `json:"-"` + Hash util.Uint160 `json:"hash"` Documents []string `json:"documents"` Methods []MethodDebugInfo `json:"methods"` Events []EventDebugInfo `json:"events"` @@ -125,6 +127,7 @@ func (c *codegen) saveSequencePoint(n ast.Node) { func (c *codegen) emitDebugInfo(contract []byte) *DebugInfo { d := &DebugInfo{ + Hash: hash.Hash160(contract), MainPkg: c.mainPkg.Name, Events: []EventDebugInfo{}, Documents: c.documents,