diff --git a/cli/nep11_test.go b/cli/nep11_test.go index a1c847e02..7a7b8ff1e 100644 --- a/cli/nep11_test.go +++ b/cli/nep11_test.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "io" "io/ioutil" "os" @@ -211,6 +212,22 @@ func TestNEP11_OwnerOf_BalanceOf_Transfer(t *testing.T) { e.Run(t, cmdTokensOf...) e.checkNextLine(t, string(tokenID)) + // properties: no contract + cmdProperties := []string{ + "neo-go", "wallet", "nep11", "properties", + "--rpc-endpoint", "http://" + e.RPC.Addr, + } + e.RunWithError(t, cmdProperties...) + cmdProperties = append(cmdProperties, "--token", h.StringLE()) + + // properties: no token ID + e.RunWithError(t, cmdProperties...) + cmdProperties = append(cmdProperties, "--id", string(tokenID)) + + // properties: ok + e.Run(t, cmdProperties...) + e.checkNextLine(t, fmt.Sprintf(`{"name":"HASHY %s"}`, string(tokenID))) + // tokensOf: good, several tokens tokenID1 := mint(t) e.Run(t, cmdTokensOf...) diff --git a/cli/wallet/nep11.go b/cli/wallet/nep11.go index 2d6df9289..ee20157b7 100644 --- a/cli/wallet/nep11.go +++ b/cli/wallet/nep11.go @@ -14,6 +14,7 @@ import ( "github.com/nspcc-dev/neo-go/pkg/rpc/client" "github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest" "github.com/nspcc-dev/neo-go/pkg/util" + "github.com/nspcc-dev/neo-go/pkg/vm/stackitem" "github.com/nspcc-dev/neo-go/pkg/wallet" "github.com/urfave/cli" ) @@ -91,6 +92,16 @@ func newNEP11Commands() []cli.Command { signer. `, }, + { + Name: "properties", + Usage: "print properties of NEP11 token", + UsageText: "properties --rpc-endpoint --timeout