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

Voluntary exit CLI/Client integration #7162

Merged
merged 26 commits into from Sep 9, 2020
Merged

Voluntary exit CLI/Client integration #7162

merged 26 commits into from Sep 9, 2020

Conversation

rkapka
Copy link
Contributor

@rkapka rkapka commented Sep 2, 2020

What type of PR is this?

Feature

What does this PR do? Why is it needed?

The aim of this PR is to provide full integration between the CLI command for performing an exit, the validator and the gRPC validator client.

Which issues(s) does this PR fix?

Part of #6882

Other notes for review

N/A

# Conflicts:
#	validator/accounts/v2/accounts_exit.go
validator/accounts/v2/accounts_exit.go Outdated Show resolved Hide resolved
validator/accounts/v2/accounts_exit.go Outdated Show resolved Hide resolved
@@ -81,3 +81,5 @@ func TestExitAccountsCli_EmptyWalletReturnsError(t *testing.T) {
err = ExitAccountsCli(cliCtx, os.Stdin)
assert.ErrorContains(t, "wallet is empty, no accounts to perform voluntary exit", err)
}

// TODO: Write an integration test?
Copy link
Member

Choose a reason for hiding this comment

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

yes, please add test

@rkapka rkapka changed the title Propose exit flow Voluntary exit CLI/Client integration Sep 6, 2020
@rkapka rkapka marked this pull request as ready for review September 8, 2020 08:38
@rkapka rkapka requested a review from a team as a code owner September 8, 2020 08:38
@rkapka
Copy link
Contributor Author

rkapka commented Sep 8, 2020

TestExitAccountsCli_Ok() fails because of these two lines:

validatorClient := ethpb.NewBeaconNodeValidatorClient(conn)
nodeClient := ethpb.NewNodeClient(conn)

I am Newing the clients and because of this I cannot use gomock to mock them. Is there any standard pattern that should be used here? Initialize them inside main() and pass into ExitAccountsCli() so that I can pass a mock implementation in tests?

@rkapka rkapka added Ready For Review A pull request ready for code review and removed Ready For Review A pull request ready for code review labels Sep 9, 2020
@rkapka rkapka added the Ready For Review A pull request ready for code review label Sep 9, 2020
@codecov
Copy link

codecov bot commented Sep 9, 2020

Codecov Report

Merging #7162 into master will decrease coverage by 0.10%.
The diff coverage is 40.90%.

@@            Coverage Diff             @@
##           master    #7162      +/-   ##
==========================================
- Coverage   61.64%   61.53%   -0.11%     
==========================================
  Files         411      410       -1     
  Lines       32628    32657      +29     
==========================================
- Hits        20112    20095      -17     
- Misses       9647     9693      +46     
  Partials     2869     2869              

Copy link
Contributor

@rauljordan rauljordan left a comment

Choose a reason for hiding this comment

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

Nice work on this one!

@rauljordan rauljordan merged commit 94fa046 into master Sep 9, 2020
@delete-merged-branch delete-merged-branch bot deleted the propose-exit-flow branch September 9, 2020 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants