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

Add staking cli test #33

Merged
merged 14 commits into from
Apr 24, 2020
Merged

Conversation

sahith-narahari
Copy link

  • Targeted PR against correct branch (see CONTRIBUTING.md)

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.

  • Wrote tests

  • Updated relevant documentation (docs/)

  • Added entries in PENDING.md with issue #

  • rereviewed Files changed in the github PR explorer


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@sahith-narahari
Copy link
Author

Please don't merge

@aaronc
Copy link
Member

aaronc commented Apr 22, 2020

Please don't merge

For this you can mark it as a draft again @sahith-narahari

Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

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

This looks like a good start. Obviously the helpers still depend on staking, etc. and eventually we'll want to modularize that. Not sure if we should tackle here or in a later PR.

@aaronc
Copy link
Member

aaronc commented Apr 22, 2020

An easy way to modularize the helpers is to create a file like x/staking/client/cli/test_helpers.go and put TxStakingEditValidator, etc. as a function with *Fixtures as the first param. Ex:

func TxStakingEditValidator(f  *Fixtures, from string, flags ...string) (bool, string, string) {
...

I think these functions can live in the modules they relate to. Would that work?

/cc @anilcse

@sahith-narahari
Copy link
Author

An easy way to modularize the helpers is to create a file like x/staking/client/cli/test_helpers.go and put TxStakingEditValidator, etc. as a function with *Fixtures as the first param. Ex:

func TxStakingEditValidator(f  *Fixtures, from string, flags ...string) (bool, string, string) {
...

I think these functions can live in the modules they relate to. Would that work?

/cc @anilcse

This approach should be fine, will try to migrate for a module and update

@sahith-narahari sahith-narahari marked this pull request as draft April 23, 2020 16:38
@sahith-narahari
Copy link
Author

@aaronc I migrated tests and respective helpers to corresponding modules as suggested.
I believe it's good to have gaiad commands and keys commands to be in sdk/cli_test for now as they're used in test initialization, but this is definitely something we can modularize in future(any suggestions are welcome)

Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

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

This looks good. Nicely modularized!

@aaronc
Copy link
Member

aaronc commented Apr 23, 2020

@aaronc I migrated tests and respective helpers to corresponding modules as suggested.
I believe it's good to have gaiad commands and keys commands to be in sdk/cli_test for now as they're used in test initialization, but this is definitely something we can modularize in future(any suggestions are welcome)

Okay, we can start with what's simplest for now.

@sahith-narahari sahith-narahari marked this pull request as ready for review April 23, 2020 19:23
@sahith-narahari sahith-narahari marked this pull request as draft April 23, 2020 19:26
@sahith-narahari sahith-narahari marked this pull request as ready for review April 24, 2020 16:20
@sahith-narahari sahith-narahari merged commit 6f79058 into sahith/add-base-setup Apr 24, 2020
@ryanchristo ryanchristo deleted the sahith/add-staking-tests branch December 12, 2022 18:16
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.

3 participants