forked from TrueCloudLab/neoneo-go
vm: pretty-print SYSCALL opcode
This commit is contained in:
parent
a796f2b61d
commit
b2e53fedac
1 changed files with 6 additions and 1 deletions
|
@ -13,6 +13,7 @@ import (
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
|
"github.com/nspcc-dev/neo-go/pkg/core/interop/interopnames"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/encoding/bigint"
|
"github.com/nspcc-dev/neo-go/pkg/encoding/bigint"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/smartcontract"
|
"github.com/nspcc-dev/neo-go/pkg/smartcontract"
|
||||||
|
@ -197,7 +198,11 @@ func (v *VM) PrintOps() {
|
||||||
case opcode.INITSLOT:
|
case opcode.INITSLOT:
|
||||||
desc = fmt.Sprintf("%d local, %d arg", parameter[0], parameter[1])
|
desc = fmt.Sprintf("%d local, %d arg", parameter[0], parameter[1])
|
||||||
case opcode.SYSCALL:
|
case opcode.SYSCALL:
|
||||||
desc = fmt.Sprintf("%q", parameter)
|
name, err := interopnames.FromID(GetInteropID(parameter))
|
||||||
|
if err != nil {
|
||||||
|
name = "not found"
|
||||||
|
}
|
||||||
|
desc = fmt.Sprintf("%s (%x)", name, parameter)
|
||||||
case opcode.PUSHINT8, opcode.PUSHINT16, opcode.PUSHINT32,
|
case opcode.PUSHINT8, opcode.PUSHINT16, opcode.PUSHINT32,
|
||||||
opcode.PUSHINT64, opcode.PUSHINT128, opcode.PUSHINT256:
|
opcode.PUSHINT64, opcode.PUSHINT128, opcode.PUSHINT256:
|
||||||
val := bigint.FromBytes(parameter)
|
val := bigint.FromBytes(parameter)
|
||||||
|
|
Loading…
Reference in a new issue