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

CSUB-589: changed sensitive input to interactive or env vars #1151

Merged
merged 13 commits into from
Jun 21, 2023

Conversation

jonZlotnik
Copy link
Contributor

Description of proposed changes


Practical tips for PR review & merge:

  • All GitHub Actions report PASS
  • Newly added code/functions have unit tests
    • Coverage tools report all newly added lines as covered
    • The positive scenario is exercised
    • Negative scenarios are exercised, e.g. assert on all possible errors
    • Assert on events triggered if applicable
    • Assert on changes made to storage if applicable
  • Modified behavior/functions - try to make sure above test items are covered
  • Integration tests are added if applicable/needed

@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2023

Codecov Report

Merging #1151 (c906c80) into dev (b23422d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##              dev    #1151   +/-   ##
=======================================
  Coverage   74.62%   74.62%           
=======================================
  Files          74       74           
  Lines       10686    10686           
=======================================
  Hits         7974     7974           
  Misses       2712     2712           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jonZlotnik jonZlotnik marked this pull request as ready for review June 21, 2023 08:55
@jonZlotnik jonZlotnik requested a review from dlebee June 21, 2023 09:09
@github-actions
Copy link

For full LLVM coverage report click here!

Copy link
Contributor

@atodorov atodorov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a stash seed from ENV looks good:

$ node dist/index.js bond -u ws://127.0.0.1:9946   -c 5EEoJZYPpTYGX1t3shaQbqhRmqvdvoaTycY1gJ4TB8spDgPp -a 1000005 -r Staked
2023-06-21 15:12:27        API/INIT: RPC methods not decorated: creditcoin_hashrate, task_getOffchainNonceKey
2023-06-21 15:12:27        API/INIT: creditcoin-node/222: Not decorating unknown runtime apis: TaskApi/1
Creating bond transaction...
Controller address: 5EEoJZYPpTYGX1t3shaQbqhRmqvdvoaTycY1gJ4TB8spDgPp
Reward destination: Staked
Amount: 1000005
✔ Continue? … yes
Extra:  undefined
Bond transaction sent with hash: 0x66a41e3f1edd0bfcd43cd565a8b0c2f191856c79afd587c0fe4b04665c6786da

Overall looks good. Added a few comments.

scripts/cc-cli/src/utils/account.ts Outdated Show resolved Hide resolved
scripts/cc-cli/src/utils/account.ts Show resolved Hide resolved
scripts/cc-cli/src/commands/send.ts Outdated Show resolved Hide resolved
scripts/cc-cli/src/commands/unbond.ts Outdated Show resolved Hide resolved
scripts/cc-cli/src/commands/distributeRewards.ts Outdated Show resolved Hide resolved
@atodorov atodorov changed the title changed sensitive input to interactive or env vars CSUB-589: changed sensitive input to interactive or env vars Jun 21, 2023
@atodorov atodorov self-requested a review June 21, 2023 16:53
Copy link
Contributor

@atodorov atodorov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the seed for unbond is incorrect. The rest are cosmetic issues but nice to have while we're at it.

scripts/cc-cli/src/commands/unbond.ts Outdated Show resolved Hide resolved
scripts/cc-cli/src/commands/setKeys.ts Outdated Show resolved Hide resolved
scripts/cc-cli/src/commands/send.ts Outdated Show resolved Hide resolved
scripts/cc-cli/src/commands/withdrawUnbonded.ts Outdated Show resolved Hide resolved
@jonZlotnik
Copy link
Contributor Author

I think the seed for unbond is incorrect. The rest are cosmetic issues but nice to have while we're at it.

I think I fixed all the issues.

Copy link
Contributor

@atodorov atodorov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am able to specify the seeds manually via the keyboard, also pasting with the mouse on Linux and also via ENV vars. LGTM.

@AdaJane AdaJane merged commit 6dc67c3 into dev Jun 21, 2023
@AdaJane AdaJane deleted the CSUB-589-remove-secret-cli-parameters-and-files branch June 21, 2023 20:45
dlebee pushed a commit that referenced this pull request Jun 22, 2023
* changed sensitive input to interactive or env vars

* improved error handling in getSeedFromEnvOrPrompt

* yarn format

* eslint

* changed prompt from invisible to password

* centralized the regular seed

* rectified stash vs bond key elicitation

* set_keys actor rectification

* make pretty

* unbound to controller seed

* appropriate names

* prettify

---------

Co-authored-by: Jon Zlotnik <jon.zlotnik@gluwa.com>
AdaJane pushed a commit that referenced this pull request Jun 26, 2023
* changed sensitive input to interactive or env vars

* improved error handling in getSeedFromEnvOrPrompt

* yarn format

* eslint

* changed prompt from invisible to password

* centralized the regular seed

* rectified stash vs bond key elicitation

* set_keys actor rectification

* make pretty

* unbound to controller seed

* appropriate names

* prettify

---------

Co-authored-by: Jon Zlotnik <jon.zlotnik@gluwa.com>
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

Successfully merging this pull request may close these issues.

4 participants