Commit graph

19 commits

Author SHA1 Message Date
Anna Shaleva
95cbddf19e cli: use custom logger to filter out runtime.Log messages
```
anna@kiwi:~/Documents/GitProjects/nspcc-dev/neo-go$ ./bin/neo-go vm -p

    _   ____________        __________      _    ____  ___
   / | / / ____/ __ \      / ____/ __ \    | |  / /  |/  /
  /  |/ / __/ / / / /_____/ / __/ / / /____| | / / /|_/ /
 / /|  / /___/ /_/ /_____/ /_/ / /_/ /_____/ |/ / /  / /
/_/ |_/_____/\____/      \____/\____/      |___/_/  /_/

NEO-GO-VM > loadgo ./1-print/1-print.go
READY: loaded 21 instructions
NEO-GO-VM 0 > run
2022-10-07T15:28:20.461+0300	INFO	runtime log	{"tx": "", "script": "db03ceb3f672ee8cd0d714989b4d103ff7eed2f3", "msg": "Hello, world!"}
[]
```
2022-10-07 15:57:33 +03:00
Anna Shaleva
b2cd007d8d cli: move handleLoggingParams to 'options' package
It will be reused by other CLI packages.
2022-10-07 15:57:33 +03:00
Anna Shaleva
5698ce03be cli: move debug flag to options package 2022-10-06 14:01:56 +03:00
Anna Shaleva
37571162a0 cli: move config path flag to options package 2022-10-06 14:01:56 +03:00
Roman Khimov
1ac60ada19 cli: move tests to subpackages
Refs. #2379, but not completely solves it, one package seriously outweights
others:

?       github.com/nspcc-dev/neo-go/cli [no test files]
ok      github.com/nspcc-dev/neo-go/cli/app     0.036s  coverage: 100.0% of statements
ok      github.com/nspcc-dev/neo-go/cli/cmdargs 0.011s  coverage: 60.8% of statements
ok      github.com/nspcc-dev/neo-go/cli/flags   0.009s  coverage: 97.7% of statements
?       github.com/nspcc-dev/neo-go/cli/input   [no test files]
ok      github.com/nspcc-dev/neo-go/cli/options 0.033s  coverage: 50.0% of statements
?       github.com/nspcc-dev/neo-go/cli/paramcontext    [no test files]
ok      github.com/nspcc-dev/neo-go/cli/query   2.155s  coverage: 45.3% of statements
ok      github.com/nspcc-dev/neo-go/cli/server  1.373s  coverage: 67.8% of statements
ok      github.com/nspcc-dev/neo-go/cli/smartcontract   8.819s  coverage: 94.3% of statements
ok      github.com/nspcc-dev/neo-go/cli/util    0.006s  coverage: 10.9% of statements
?       github.com/nspcc-dev/neo-go/cli/vm      [no test files]
ok      github.com/nspcc-dev/neo-go/cli/wallet  72.103s coverage: 88.2% of statements

Still a nice thing to have.
2022-10-06 09:21:26 +03:00
Roman Khimov
d2d190913b cli: add historic abilities for all invoking commands
Notice that we can't do this for balance commands (unless we change the
interface in some manner) because they use getnepXXbalances.

Fixes #2620.
2022-09-08 19:20:18 +03:00
Roman Khimov
1367d0df00 cli: provide more explanations for node options 2022-08-05 16:04:56 +03:00
Roman Khimov
8c668765d2 rpc/client: move to pkg/rpcclient
Better package name, closer to user.
2022-07-21 22:39:53 +03:00
Elizaveta Chichindaeva
28908aa3cf [#2442] English Check
Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
2022-05-04 19:48:27 +03:00
Anna Shaleva
a1ed4be223 cli: properly set default timeout for RPC flag
Old help message is misleading a bit:
```
OPTIONS:
   --verbose, -v                   Output full tx info and execution logs
   --rpc-endpoint value, -r value  RPC node address
   --timeout value, -s value       Timeout for the operation (10 seconds by default) (default: 0s)
```

The new one:
```
OPTIONS:
   --verbose, -v                   Output full tx info and execution logs
   --rpc-endpoint value, -r value  RPC node address
   --timeout value, -s value       Timeout for the operation (default: 10s)
```
2022-03-25 16:14:04 +03:00
AnnaShaleva
670af050ee cli: fix TestGetTimeoutContext test
Problem:
```
--- FAIL: TestGetTimeoutContext (0.00s)
    --- FAIL: TestGetTimeoutContext/default (0.00s)
        options_test.go:44:
                Error Trace:    options_test.go:44
                Error:          Should be true
                Test:           TestGetTimeoutContext/default
    --- FAIL: TestGetTimeoutContext/set (0.00s)
        options_test.go:55:
                Error Trace:    options_test.go:55
                Error:          Should be true
                Test:           TestGetTimeoutContext/set
FAIL
```

Solution:
Allow deadline be equal to expected end time.
2021-11-18 17:35:15 +03:00
Anna Shaleva
b8a88f9378 rpc: allow to use address, id or name instead of scripthash [Client]
... for getcontractstate RPC client method.
2020-11-03 17:58:24 +03:00
Anna Shaleva
795823ee3b cli: fixed removed network arguments
Should be done in 590be7a58d. I removed
network flags from RPC, but we still need them for server-related
cli commands.
2020-10-21 17:41:23 +03:00
Anna Shaleva
590be7a58d rpc, cli: remove Network from RPC client and cli 2020-10-19 16:11:11 +03:00
Evgenii Stratonikov
d30c7db49a cli: add tests for NEP5 transfer 2020-09-18 12:07:02 +03:00
Anna Shaleva
cab767dafe cli: add tests to cli packages
Closes #1336
2020-08-26 10:14:55 +03:00
Roman Khimov
d22286cbbc client/cli: add network option to the RPC client
It doesn't affect anything yet, but it's going to be used in the future for
network-specific behavior. It also renames short '--timeout' form to '-s'
avoiding conlict with '-t' used for '--testnet'.
2020-06-18 12:11:13 +03:00
Roman Khimov
16ce63e653 cli: unify RPC endpoint flags under options package
This makes rpc flags consistent across all commands, previously some commands
used 'endpoint, e' and some 'rpc, r', some had ability to change timeout and
some hadn't. Now 'rpc-endpoint, r' is used everywhere along with 'timeout, t'.
2020-06-18 12:10:59 +03:00
Roman Khimov
f2c4b9b1d9 cli: move network options to their own package
They will be reused.
2020-06-18 12:10:14 +03:00