Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tester-cli: flags not forwarded when running command programmatically #2094

Closed
Nigui opened this issue Feb 13, 2019 · 5 comments
Closed

tester-cli: flags not forwarded when running command programmatically #2094

Nigui opened this issue Feb 13, 2019 · 5 comments
Assignees

Comments

@Nigui
Copy link
Contributor

Nigui commented Feb 13, 2019

Describe the bug
In the Vote command of tester-cli, Transfer command is called to initialize wallet balance (source)

Overriding base command flags (like p2pPort) during the vote command call, make transfer command crash due to invalid port used (default port of base command instead of source command port value).

It produces the following error:

[1550055840041] ERROR (core-tester-cli/28311 on laptop.local): Failed to get network config:  connect ECONNREFUSED 127.0.0.1:4002
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce
Steps to reproduce the behavior:

  1. Start a testnet node (p2pPort is 4000 by default)
  2. Go to core-tester-cli
  3. yarn tester vote [...] --p2pPort 4000
  4. See error

Expected behavior
flags used in source command should be forwarded to programmatically called commands.

@ghost
Copy link

ghost commented Feb 13, 2019

@Nigui Thanks for opening this issue, a maintainer will get back to you shortly!

@ghost
Copy link

ghost commented Feb 13, 2019

@air1one @faustbrian @supaiku0 - please review this in the next few days. Be sure to explicitly select labels so I know what's going on.

If no reviewer appears after a week, a reminder will be sent out.

@ghost ghost added the Status: Needs Review label Feb 13, 2019
@Nigui
Copy link
Contributor Author

Nigui commented Feb 13, 2019

Tried to give this.options as second parameter of Transfer.run(...), but it produces the following error:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at up (~/Documents/projects/ark/core/node_modules/@oclif/config/lib/plugin.js:206:21)
    at up.next (<anonymous>)
    at findRoot (~/Documents/projects/ark/core/node_modules/@oclif/config/lib/plugin.js:212:14)
    at Plugin.load (~/Documents/projects/ark/core/node_modules/@oclif/config/lib/plugin.js:25:28)
    at Config.load (~/Documents/projects/ark/core/node_modules/@oclif/config/lib/config.js:28:22)
    at Object.load (~/Documents/projects/ark/core/node_modules/@oclif/config/lib/config.js:307:18)
    at Function.Command.run (~/Documents/projects/ark/core/node_modules/@oclif/command/lib/command.js:141:33)
    at NFTMint.run (~/Documents/projects/ark/core/packages/core-tester-cli/dist/commands/nftmint.js:23:46)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Maybe solution should be to manually forward flags, serializing as a string array and passing to Transfer.run first parameter.

@faustbrian
Copy link
Contributor

Will take a look next week when I find time unless you've send a PR by then @Nigui.

@ghost
Copy link

ghost commented Feb 18, 2019

@Nigui This issue has been closed. If you wish to re-open it please provide additional information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants