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

Fix skip confirm logic #7085

Merged
merged 9 commits into from
Aug 21, 2020
Merged

Fix skip confirm logic #7085

merged 9 commits into from
Aug 21, 2020

Conversation

sahith-narahari
Copy link
Contributor

@sahith-narahari sahith-narahari commented Aug 18, 2020

Description

This PR addresses issues with flags skip-confirmation and dry-run

closes: #7079


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • 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.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@codecov
Copy link

codecov bot commented Aug 18, 2020

Codecov Report

Merging #7085 into master will decrease coverage by 1.05%.
The diff coverage is 52.65%.

@@            Coverage Diff             @@
##           master    #7085      +/-   ##
==========================================
- Coverage   55.60%   54.54%   -1.06%     
==========================================
  Files         457      550      +93     
  Lines       27440    37690   +10250     
==========================================
+ Hits        15257    20558    +5301     
- Misses      11083    15442    +4359     
- Partials     1100     1690     +590     

std/pubkey.go Outdated Show resolved Hide resolved
std/pubkey.go Outdated Show resolved Hide resolved
@sahith-narahari
Copy link
Contributor Author

Liveness test is broken on master and being tackled here #7095

Comment on lines +23 to +25
if key == nil {
return nil, nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

if the pubkey is nil, error makes sense. Is there a reason to handle nil separately?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nil is a valid pubkey, so it shouldn't error

Copy link
Contributor

@amaury1093 amaury1093 Aug 19, 2020

Choose a reason for hiding this comment

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

I thought PublicKey was a sum. Can you explain how nil is a valid pubkey?

Edit: we're migrating to Any, but imo it should still not be nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't have full context, @aaronc can explain better

Copy link
Member

@aaronc aaronc Aug 19, 2020

Choose a reason for hiding this comment

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

All fields in proto are optional by default but pubkey is definitely optional. nil is correct here. I can't think of any other good way to handle this. Let's add an explanatory comment.

Copy link
Member

Choose a reason for hiding this comment

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

We should also add a case for key.Sum being nil.

@jgimeno jgimeno linked an issue Aug 21, 2020 that may be closed by this pull request
Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

LGTM.

Could you add aaron's 2 suggestions?

Let's add an explanatory comment.

We should also add a case for key.Sum being nil.

@amaury1093 amaury1093 added the A:automerge Automatically merge PR once all prerequisites pass. label Aug 21, 2020
@mergify mergify bot merged commit 2e1fbae into master Aug 21, 2020
@mergify mergify bot deleted the sahith/fix-skip-confirm branch August 21, 2020 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass.
Projects
None yet
6 participants