cli: rename VMCLI to CLI

This commit is contained in:
Anna Shaleva 2022-10-07 15:47:21 +03:00
parent 16f5ae3812
commit eac5e1526e
2 changed files with 8 additions and 8 deletions

View file

@ -354,15 +354,15 @@ var (
ErrInvalidParameter = errors.New("can't parse argument")
)
// VMCLI object for interacting with the VM.
type VMCLI struct {
// CLI object for interacting with the VM.
type CLI struct {
chain *core.Blockchain
shell *cli.App
}
// NewWithConfig returns new VMCLI instance using provided config and (optionally)
// NewWithConfig returns new CLI instance using provided config and (optionally)
// provided node config for state-backed VM.
func NewWithConfig(printLogotype bool, onExit func(int), c *readline.Config, cfg config.Config) (*VMCLI, error) {
func NewWithConfig(printLogotype bool, onExit func(int), c *readline.Config, cfg config.Config) (*CLI, error) {
if c.AutoComplete == nil {
// Autocomplete commands/flags on TAB.
c.AutoComplete = completer
@ -426,7 +426,7 @@ func NewWithConfig(printLogotype bool, onExit func(int), c *readline.Config, cfg
return nil, cli.NewExitError(fmt.Errorf("failed to create test VM: %w", err), 1)
}
vmcli := VMCLI{
vmcli := CLI{
chain: chain,
shell: ctl,
}
@ -1063,7 +1063,7 @@ func dumpEvents(app *cli.App) (string, error) {
}
// Run waits for user input from Stdin and executes the passed command.
func (c *VMCLI) Run() error {
func (c *CLI) Run() error {
if getPrintLogoFromContext(c.shell) {
printLogo(c.shell.Writer)
}

View file

@ -62,7 +62,7 @@ func (r *readCloser) WriteString(s string) {
type executor struct {
in *readCloser
out *bytes.Buffer
cli *VMCLI
cli *CLI
ch chan struct{}
exit atomic.Bool
}
@ -126,7 +126,7 @@ func newTestVMClIWithState(t *testing.T) *executor {
basicchain.InitSimple(t, "../../", e)
bc.Close()
// After that create VMCLI backed by created chain.
// After that create CLI backed by created chain.
configPath := "../../config/protocol.unit_testnet.yml"
cfg, err := config.LoadFile(configPath)
require.NoError(t, err)