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") ErrInvalidParameter = errors.New("can't parse argument")
) )
// VMCLI object for interacting with the VM. // CLI object for interacting with the VM.
type VMCLI struct { type CLI struct {
chain *core.Blockchain chain *core.Blockchain
shell *cli.App 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. // 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 { if c.AutoComplete == nil {
// Autocomplete commands/flags on TAB. // Autocomplete commands/flags on TAB.
c.AutoComplete = completer 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) return nil, cli.NewExitError(fmt.Errorf("failed to create test VM: %w", err), 1)
} }
vmcli := VMCLI{ vmcli := CLI{
chain: chain, chain: chain,
shell: ctl, 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. // 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) { if getPrintLogoFromContext(c.shell) {
printLogo(c.shell.Writer) printLogo(c.shell.Writer)
} }

View file

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