cli: remove Can't find matching token in the wallet warning

This commit is contained in:
Anna Shaleva 2021-06-17 11:29:16 +03:00
parent 880843b17b
commit 67fe2a82bc
2 changed files with 3 additions and 6 deletions

View file

@ -184,10 +184,9 @@ func getNEP11Balance(ctx *cli.Context) error {
} }
token, err := getMatchingToken(ctx, wall, name, manifest.NEP11StandardName) token, err := getMatchingToken(ctx, wall, name, manifest.NEP11StandardName)
if err != nil { if err != nil {
fmt.Fprintln(ctx.App.ErrWriter, "Can't find matching token in the wallet. Querying RPC-node for token info.")
tokenHash, err := flags.ParseAddress(name) tokenHash, err := flags.ParseAddress(name)
if err != nil { if err != nil {
return cli.NewExitError(fmt.Sprintf("valid token adress or hash in LE should be specified for RPC-node request: %s", err.Error()), 1) return cli.NewExitError(fmt.Errorf("can't fetch matching token from RPC-node: %w", err), 1)
} }
token, err = c.NEP11TokenInfo(tokenHash) token, err = c.NEP11TokenInfo(tokenHash)
if err != nil { if err != nil {

View file

@ -440,10 +440,9 @@ func multiTransferNEP17(ctx *cli.Context) error {
if !ok { if !ok {
token, err = getMatchingToken(ctx, wall, ss[0], manifest.NEP17StandardName) token, err = getMatchingToken(ctx, wall, ss[0], manifest.NEP17StandardName)
if err != nil { if err != nil {
fmt.Fprintln(ctx.App.ErrWriter, "Can't find matching token in the wallet. Querying RPC-node for balances.")
token, err = getMatchingTokenRPC(ctx, c, from, ss[0], manifest.NEP17StandardName) token, err = getMatchingTokenRPC(ctx, c, from, ss[0], manifest.NEP17StandardName)
if err != nil { if err != nil {
return cli.NewExitError(err, 1) return cli.NewExitError(fmt.Errorf("can't fetch matching token from RPC-node: %w", err), 1)
} }
} }
} }
@ -509,10 +508,9 @@ func transferNEP(ctx *cli.Context, standard string) error {
to := toFlag.Uint160() to := toFlag.Uint160()
token, err := getMatchingToken(ctx, wall, ctx.String("token"), standard) token, err := getMatchingToken(ctx, wall, ctx.String("token"), standard)
if err != nil { if err != nil {
fmt.Fprintln(ctx.App.ErrWriter, "Can't find matching token in the wallet. Querying RPC-node for balances.")
token, err = getMatchingTokenRPC(ctx, c, from, ctx.String("token"), standard) token, err = getMatchingTokenRPC(ctx, c, from, ctx.String("token"), standard)
if err != nil { if err != nil {
return cli.NewExitError(fmt.Errorf("failed to get matching token: %w", err), 1) return cli.NewExitError(fmt.Errorf("can't fetch matching token from RPC-node: %w", err), 1)
} }
} }