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

general QGB cosmetics #576

Merged
merged 6 commits into from
Jul 29, 2022
Merged

Conversation

rach-id
Copy link
Member

@rach-id rach-id commented Jul 28, 2022

Description

Cosmetics


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

@rach-id rach-id added the C: QGB label Jul 28, 2022
@rach-id rach-id requested a review from evan-forbes July 28, 2022 12:26
@rach-id rach-id self-assigned this Jul 28, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 28, 2022

Codecov Report

Merging #576 (ffa4527) into qgb-integration (6b0f7ee) will not change coverage.
The diff coverage is 9.09%.

@@               Coverage Diff               @@
##           qgb-integration    #576   +/-   ##
===============================================
  Coverage             9.76%   9.76%           
===============================================
  Files                   55      55           
  Lines                 9036    9036           
===============================================
  Hits                   882     882           
  Misses                8075    8075           
  Partials                79      79           
Impacted Files Coverage Δ
e2e/qgb/qgb_network.go 0.00% <0.00%> (ø)
x/qgb/abci.go 44.89% <0.00%> (ø)
x/qgb/handler.go 80.00% <ø> (ø)
x/qgb/keeper/query_general.go 0.00% <ø> (ø)
x/qgb/keeper/query_valset_confirm.go 76.92% <ø> (ø)
x/qgb/module.go 3.50% <ø> (ø)
x/qgb/types/abi_consts.go 69.23% <ø> (ø)
x/qgb/types/data_commitment.go 0.00% <ø> (ø)
x/qgb/types/ethereum_signer.go 70.00% <ø> (ø)
x/qgb/types/keys.go 0.00% <ø> (ø)
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

e2e/qgb/qgb_network.go Outdated Show resolved Hide resolved
e2e/qgb/qgb_network.go Outdated Show resolved Hide resolved
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

only a few minor nits/comments. I'll defer to your judgment tho, so approving 🙂

@@ -2,4 +2,14 @@ package e2e

import "errors"

var ErrNetworkStopped = errors.New("network is stopping")
var (
ErrNetworkStopped = errors.New("network is stopping")
Copy link
Member

Choose a reason for hiding this comment

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

nit: we should probably match the tense of the name of the variable with the error message. So like, "network has stopped" or ErrNetworkingStopping. Where is this used btw?

var ErrNetworkStopped = errors.New("network is stopping")
var (
ErrNetworkStopped = errors.New("network is stopping")
ErrRelayerStart = errors.New("relayer didn't start correctly")
Copy link
Member

Choose a reason for hiding this comment

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

nit: perhaps we could be more specific, like since we use this when we reach a deadline, we could simply reflect that

ErrValsetNotFound = errors.New("couldn't find valset")
ErrHeightNotReached = errors.New("couldn't reach wanted heigh")
ErrNodeStart = errors.New("node didn't start correctly")
ErrEmpty = errors.New("empty")
Copy link
Member

Choose a reason for hiding this comment

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

nit: this error message might be too abstract considering we have to wrap it each time we use it. empty what? If we don't want to create a flag for each thing like EmptyFlag or EmptyService, which might be going overboard, then we can just do what we're doing now but keep not wrap this error. pls see other comments for examples

return fmt.Errorf("empty list of services provided")
return fmt.Errorf("list of services provided: %w", ErrEmpty)
Copy link
Member

Choose a reason for hiding this comment

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

nit: I actually think we don't need this change as the first is more descriptive and wrapping the word empty doesn't really give us anything. see other comment above

return orchestratorConfig{}, errors.New("private key flag required")
return orchestratorConfig{}, fmt.Errorf("%s: %w", privateKeyFlag, ErrEmpty)
Copy link
Member

Choose a reason for hiding this comment

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

nit: similar to the other comments, I'm not sure this change is actually better from both from a user's point of view and a reader of the code. The previous error message is really good cause it tells the user exactly what they need to do to fix the issue while also not making the readers of the code lookup what ErrEmpty says/means.

@rach-id
Copy link
Member Author

rach-id commented Jul 28, 2022

Thanks for the comments. Probably, it would be best to remove the errors from this PR and handle them separately. What do you think? @evan-forbes @rootulp

@evan-forbes
Copy link
Member

Probably, it would be best to remove the errors from this PR and handle them separately.

sounds good to me 👍 @sweexordious

@rach-id rach-id merged commit 195da78 into celestiaorg:qgb-integration Jul 29, 2022
@rach-id rach-id deleted the cosmetics branch July 29, 2022 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants