mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-11 01:20:37 +00:00
parent
4d07d72677
commit
6cc3d9bcc3
2 changed files with 10 additions and 13 deletions
|
@ -17,7 +17,6 @@ import (
|
||||||
// DebugInfo represents smart-contract debug information.
|
// DebugInfo represents smart-contract debug information.
|
||||||
type DebugInfo struct {
|
type DebugInfo struct {
|
||||||
Hash util.Uint160 `json:"hash"`
|
Hash util.Uint160 `json:"hash"`
|
||||||
EntryPoint string `json:"entrypoint"`
|
|
||||||
Documents []string `json:"documents"`
|
Documents []string `json:"documents"`
|
||||||
Methods []MethodDebugInfo `json:"methods"`
|
Methods []MethodDebugInfo `json:"methods"`
|
||||||
Events []EventDebugInfo `json:"events"`
|
Events []EventDebugInfo `json:"events"`
|
||||||
|
@ -135,7 +134,6 @@ func (c *codegen) saveSequencePoint(n ast.Node) {
|
||||||
func (c *codegen) emitDebugInfo(contract []byte) *DebugInfo {
|
func (c *codegen) emitDebugInfo(contract []byte) *DebugInfo {
|
||||||
d := &DebugInfo{
|
d := &DebugInfo{
|
||||||
Hash: hash.Hash160(contract),
|
Hash: hash.Hash160(contract),
|
||||||
EntryPoint: mainIdent,
|
|
||||||
Events: []EventDebugInfo{},
|
Events: []EventDebugInfo{},
|
||||||
}
|
}
|
||||||
for name, scope := range c.funcs {
|
for name, scope := range c.funcs {
|
||||||
|
@ -318,7 +316,7 @@ func parsePairJSON(data []byte, sep string) (string, string, error) {
|
||||||
func (di *DebugInfo) convertToABI(fs smartcontract.PropertyState) ABI {
|
func (di *DebugInfo) convertToABI(fs smartcontract.PropertyState) ABI {
|
||||||
methods := make([]Method, 0)
|
methods := make([]Method, 0)
|
||||||
for _, method := range di.Methods {
|
for _, method := range di.Methods {
|
||||||
if method.Name.Name == di.EntryPoint {
|
if method.Name.Name == mainIdent {
|
||||||
methods = append(methods, Method{
|
methods = append(methods, Method{
|
||||||
Name: method.Name.Name,
|
Name: method.Name.Name,
|
||||||
Parameters: method.Parameters,
|
Parameters: method.Parameters,
|
||||||
|
@ -340,7 +338,7 @@ func (di *DebugInfo) convertToABI(fs smartcontract.PropertyState) ABI {
|
||||||
HasStorage: fs&smartcontract.HasStorage != 0,
|
HasStorage: fs&smartcontract.HasStorage != 0,
|
||||||
IsPayable: fs&smartcontract.IsPayable != 0,
|
IsPayable: fs&smartcontract.IsPayable != 0,
|
||||||
},
|
},
|
||||||
EntryPoint: di.EntryPoint,
|
EntryPoint: mainIdent,
|
||||||
Functions: methods,
|
Functions: methods,
|
||||||
Events: events,
|
Events: events,
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,7 +179,6 @@ func TestSequencePoints(t *testing.T) {
|
||||||
func TestDebugInfo_MarshalJSON(t *testing.T) {
|
func TestDebugInfo_MarshalJSON(t *testing.T) {
|
||||||
d := &DebugInfo{
|
d := &DebugInfo{
|
||||||
Hash: util.Uint160{10, 11, 12, 13},
|
Hash: util.Uint160{10, 11, 12, 13},
|
||||||
EntryPoint: "main",
|
|
||||||
Documents: []string{"/path/to/file"},
|
Documents: []string{"/path/to/file"},
|
||||||
Methods: []MethodDebugInfo{
|
Methods: []MethodDebugInfo{
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue