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

feat(autocli): add address validation #15449

Merged
merged 20 commits into from
Mar 22, 2023

Conversation

JeancarloBarrios
Copy link
Contributor

Description

Closes: #13287


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@github-actions github-actions bot added C:CLI C:Hubl Tool: Hubl labels Mar 17, 2023
@JeancarloBarrios JeancarloBarrios marked this pull request as ready for review March 17, 2023 23:19
@JeancarloBarrios JeancarloBarrios requested a review from a team as a code owner March 17, 2023 23:19
@github-prbot github-prbot requested review from a team, alexanderbez and julienrbrt and removed request for a team March 17, 2023 23:19
@@ -29,8 +50,12 @@ func (a addressValue) String() string {
}

func (a *addressValue) Set(s string) error {
_, err := types.GetFromBech32(s, a.addressPrefix)
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 add docs that client v2 only supports bech32 here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey Marco sorry for the question, but where exactly do you envision this in the doc should I create a new category for the flags?

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

utACK. 2 nits.

@@ -119,3 +119,9 @@ require (
pgregory.net/rapid v0.5.5 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)


// Temporal for PR
Copy link
Member

Choose a reason for hiding this comment

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

Let's not forget to remove that in a follow-up of now using a pseudo version.
Otherwise hubl cannot be installed via go install.

panic(err)
}
reflectionClient := reflectionv2alpha1.NewReflectionServiceClient(conn)
if ctx == nil {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should overwrite a nil context. It may be hard to debug for the caller.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you sugest I use instead to avoid possible error because I was getting a nil pointer from the ctx being nil?

Copy link
Member

@julienrbrt julienrbrt Mar 20, 2023

Choose a reason for hiding this comment

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

I suggest just passing it. The caller needs to ensure ctx isn't 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.

Oh ok perfect, I got a panic from it while testing I will dig into the caller to check what is up

@github-actions
Copy link
Contributor

@JeancarloBarrios your pull request is missing a changelog!

@julienrbrt julienrbrt added the A:automerge Automatically merge PR once all prerequisites pass. label Mar 22, 2023
@mergify mergify bot merged commit 4866d9a into main Mar 22, 2023
@mergify mergify bot deleted the JeancarloBarrios/add-address-validation branch March 22, 2023 09:56
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. C:CLI C:Hubl Tool: Hubl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AutoCLI bech32 validation of address strings
3 participants