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

chore: expect specific errors in apps/transfer #7205

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

bznein
Copy link
Contributor

@bznein bznein commented Aug 23, 2024

Description

ref: #7175


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 the 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 and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/).
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

{
"invalid trace",
func() {
req = &types.QueryDenomHashRequest{
Trace: "transfer/channelToA/transfer/",
Trace: "transfer%%/channel-1/transfer/channel-1/uatom",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test was not triggering the "invalid trace" error but the "denom not found one". Thanks @crodriguezvega for the help!!

Copy link
Member

Choose a reason for hiding this comment

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

Is the %% what triggers invalid trace 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.

To my understanding yes, but this is all @crodriguezvega!

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, correct. The %% triggers invalid trace error.

Comment on lines -204 to -207
{
"success",
func() {},
true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved on top

testing/utils.go Outdated
@@ -81,3 +83,12 @@ func UnmarshalMsgResponses(cdc codec.Codec, data []byte, msgs ...codec.ProtoMars

return 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.

This was also added in another in-flight PR. There should be no merge conflicts, but I'll take care of them if they arise :)

Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

😍

The linter is complaining about the new function, but not sure what it's trying to tell us...

suite.Require().NoError(err)
suite.Require().NotNil(res)
suite.Require().Equal(&expDenom, res.Denom)
} else {
suite.Require().Error(err)
ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe in a separate PR we should update other tests where this function could be used... More refactoring of tests, yay!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely! But I think after these I'll take a break from refactoring tests :D

Copy link

sonarcloud bot commented Aug 28, 2024

Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

Nice one, thanks @bznein!

{
"invalid trace",
func() {
req = &types.QueryDenomHashRequest{
Trace: "transfer/channelToA/transfer/",
Trace: "transfer%%/channel-1/transfer/channel-1/uatom",
Copy link
Member

Choose a reason for hiding this comment

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

Is the %% what triggers invalid trace here?

@bznein bznein added this pull request to the merge queue Aug 28, 2024
Merged via the queue into main with commit 1af0bfc Aug 28, 2024
70 checks passed
@bznein bznein deleted the bznein/expectedErrors/transfer branch August 28, 2024 08:49
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