Commit graph

18 commits

Author SHA1 Message Date
Ekaterina Pavlova
b32e568d21 cli: don't panic when handling error
Close #2886

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-07-12 11:58:12 +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
eb67b61c0f cli: change --version output format, fix #2611 2022-07-27 16:28:40 +03:00
Evgeniy Stratonikov
7d2d9e96ef cli: add query tx command, fix #2069
Implement a way to check if tx has been persisted on blockchain and
to get general info about transaction. Much more convenient than
handwritten curl queries.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-07-20 18:03:50 +03:00
Anna Shaleva
a86bd2cd08 cli: set ctl.ErrWriter
We did not have it set, however we use it in the several places which
results with the following panic:
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x4ddf0d]

goroutine 1 [running]:
fmt.Fprintln(0x0, 0x0, 0xc0001d7c08, 0x1, 0x1, 0x10376c0, 0xc0002051c0, 0x0)
	fmt/print.go:265 +0x5d
github.com/nspcc-dev/neo-go/cli/wallet.transferNEP5(0xc0000a9080, 0x0, 0x0)
	github.com/nspcc-dev/neo-go/cli/wallet/nep5.go:445 +0x9eb
github.com/urfave/cli.HandleAction(0xc837c0, 0xf26198, 0xc0000a9080, 0xc00007f600, 0x0)
	github.com/urfave/cli@v1.20.0/app.go:490 +0xc8
github.com/urfave/cli.Command.Run(0xdc66a3, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdd0b0d, 0x14, 0xdf6c25, ...)
	github.com/urfave/cli@v1.20.0/command.go:210 +0x9e8
github.com/urfave/cli.(*App).RunAsSubcommand(0xc0001aa340, 0xc0000a8dc0, 0x0, 0x0)
	github.com/urfave/cli@v1.20.0/app.go:379 +0x88b
github.com/urfave/cli.Command.startApp(0xdc23e4, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdd546a, 0x18, 0x0, ...)
	github.com/urfave/cli@v1.20.0/command.go:298 +0x81a
github.com/urfave/cli.Command.Run(0xdc23e4, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdd546a, 0x18, 0x0, ...)
	github.com/urfave/cli@v1.20.0/command.go:98 +0x1219
github.com/urfave/cli.(*App).RunAsSubcommand(0xc0001aa1a0, 0xc0000a8c60, 0x0, 0x0)
	github.com/urfave/cli@v1.20.0/app.go:379 +0x88b
github.com/urfave/cli.Command.startApp(0xdc45bf, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0xde1d28, 0x24, 0x0, ...)
	github.com/urfave/cli@v1.20.0/command.go:298 +0x81a
github.com/urfave/cli.Command.Run(0xdc45bf, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0xde1d28, 0x24, 0x0, ...)
	github.com/urfave/cli@v1.20.0/command.go:98 +0x1219
github.com/urfave/cli.(*App).Run(0xc0001aa000, 0xc000030120, 0x12, 0x12, 0x0, 0x0)
	github.com/urfave/cli@v1.20.0/app.go:255 +0x741
main.main()
	command-line-arguments/main.go:18 +0x4b

```
2020-11-10 15:20:03 +03:00
Evgenii Stratonikov
468f7ee650 cli: add tests for NEP5 balance querying 2020-09-18 12:07:02 +03:00
Evgenii Stratonikov
227c6a2caa cli: allow to use vm parse directly 2020-08-05 09:40:50 +03:00
Anna Shaleva
5a984fdf88 config: move config.go out of config/
closes #423
2020-03-31 17:55:59 +03:00
Roman Khimov
e41d434a49 *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
Roman Khimov
dafd385f57 cli: extend NewCommand() to NewCommands()
So that each module could now return an array of commands. It's gonna be used
in the future to extend them.
2019-10-19 23:58:45 +03:00
Evgeniy Kulikov
902125cbeb
Change the way to receive version
- Used git to receive version from tags (see #304)
- Version now displayed when start node (fix #102)

Example:

→ ./bin/node --version
neo-go version 0.44.10-245-g67d5e9f

→ ./bin/node -v
neo-go version 0.44.10-245-g67d5e9f
2019-08-26 19:32:09 +03:00
Evgeniy Kulikov
f000b76879 [FIX] Formatting and code-style (#118)
* [FIX] Formatting and code-style

- gofmt
- import resort
- prealloc slices
- simplify code

* fix vet
2019-01-25 12:20:35 +01:00
Anthony De Meulemeester
931388b687
Cross platform virtual machine implementation (#60)
* Virtual machine for the NEO blockhain.

* fixed big.Int numeric operation pointer issue.

* added appcall

* Added README for vm package.

* removed main.go

* started VM cli (prompt) integration

* added support for printing the stack.

* moved cli to vm package

* fixed vet errors

* updated readme

* added more test for VM and fixed some edge cases.

* bumped version -> 0.37.0
2018-03-30 18:15:06 +02:00
Anthony De Meulemeester
f3f6662fc9
Base wallet implementation (#35)
* Initial draft of the neo-go wallet

* Cleanup + more test for util package

* integrated wallet into neo-cli partially

* base wallet implementation + smartcontract code.
2018-03-02 16:24:09 +01:00
Pawan Rawal
e93dfe8062 Better error messages (#24)
* Print proper error messages while using contract subcommands and also exit with status code 1.

* Make -in a flag, also remove dot from avm extension.

* Work on feedback by Anthony.

* Update README and VERSION
2018-02-24 10:10:45 +01:00
Anthony De Meulemeester
f7d57e4e49
VM draft + cli setup (#20)
* updated readme

* added basic cmd.

* added seperate folders for cmd packages.

* Fix netmodes in test + reverse bigint bytes

* glide get deps
2018-02-09 17:08:50 +01:00
Charlie Revett
dd94086a22
CircleCI 2 & Releases (#9) 2018-02-01 10:54:23 -08:00
Charlie Revett
36335e587f
Simplify CLI build process (#7) 2018-02-01 10:06:17 -08:00
Renamed from cmd/neoserver/main.go (Browse further)