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: rename denomination_trace event type to denomination #6467

Merged
merged 4 commits into from
Jun 5, 2024

Conversation

crodriguezvega
Copy link
Contributor

@crodriguezvega crodriguezvega commented Jun 4, 2024

Description

closes: #XXXX


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.

Summary by CodeRabbit

  • Documentation

    • Updated documentation to reflect the renaming of denomination_trace to denomination.
  • Refactor

    • Renamed EmitDenomTraceEvent function to EmitDenomEvent.
    • Updated event attributes to use the new denomination naming convention.
    • Changed event type from EventTypeDenomTrace to EventTypeDenom in relevant functions.

Copy link
Contributor

coderabbitai bot commented Jun 4, 2024

Walkthrough

The recent updates focus on renaming and adjusting event-related terminology and functionality within the transfer module of the codebase. Specifically, the changes involve renaming denomination_trace to denomination across various files, updating function names and event types accordingly. These modifications enhance clarity and consistency in the event handling related to token denominations.

Changes

File Change Summary
docs/docs/02-apps/01-transfer/05-events.md Renamed denomination_trace to denomination for the trace_hash field.
modules/apps/transfer/internal/events/events.go Renamed EmitDenomTraceEvent to EmitDenomEvent and updated event attributes related to denominations.
modules/apps/transfer/keeper/relay.go Updated event type from EventTypeDenomTrace to EventTypeDenom in the OnRecvPacket function.
modules/apps/transfer/types/events.go Changed EventTypeDenomTrace to EventTypeDenom to reflect the updated event type name.

Possibly related issues


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (2)
docs/docs/02-apps/01-transfer/05-events.md (2)

Line range hint 25-31: Remove trailing spaces to adhere to Markdown best practices.

-| fungible_token_packet | memo          | \{memo\}        | 
+| fungible_token_packet | memo          | \{memo\}        |
-| denomination          | trace_hash    | \{hex_hash\}    | 
+| denomination          | trace_hash    | \{hex_hash\}    |
Tools
Markdownlint

28-28: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


29-29: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


30-30: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


31-31: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


Line range hint 9-9: Address the issue of multiple top-level headings in the same document.

Consider restructuring the document or adjusting the heading levels to comply with best practices.

Tools
Markdownlint

28-28: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


29-29: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


30-30: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


31-31: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7598976 and 0469d96.

Files selected for processing (3)
  • docs/docs/02-apps/01-transfer/05-events.md (1 hunks)
  • modules/apps/transfer/keeper/relay.go (1 hunks)
  • modules/apps/transfer/types/events.go (1 hunks)
Additional context used
Path-based instructions (3)
modules/apps/transfer/types/events.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

docs/docs/02-apps/01-transfer/05-events.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

modules/apps/transfer/keeper/relay.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

Markdownlint
docs/docs/02-apps/01-transfer/05-events.md

25-25: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


26-26: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


27-27: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


28-28: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


29-29: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


30-30: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


31-31: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


9-9: null (MD025, single-title, single-h1)
Multiple top-level headings in the same document

golangci-lint
modules/apps/transfer/keeper/relay.go

55-55: undefined: Keeper (typecheck)


186-186: undefined: Keeper (typecheck)


326-326: undefined: Keeper (typecheck)


341-341: undefined: Keeper (typecheck)


349-349: undefined: Keeper (typecheck)


393-393: undefined: Keeper (typecheck)


409-409: undefined: Keeper (typecheck)


427-427: undefined: Keeper (typecheck)

Additional comments not posted (3)
modules/apps/transfer/types/events.go (1)

9-9: Renaming EventTypeDenomTrace to EventTypeDenom aligns with the PR's objective to simplify the event type name.

docs/docs/02-apps/01-transfer/05-events.md (1)

31-31: The documentation correctly reflects the renaming of denomination_trace to denomination for the trace_hash field.

Tools
Markdownlint

31-31: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces

modules/apps/transfer/keeper/relay.go (1)

278-278: The event type in the OnRecvPacket function has been updated from EventTypeDenomTrace to EventTypeDenom, which is consistent with the changes across the codebase.

@crodriguezvega crodriguezvega added the priority PRs that need prompt reviews label Jun 4, 2024
@chatton chatton mentioned this pull request Jun 4, 2024
16 tasks
@@ -275,7 +275,7 @@ func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, data t

ctx.EventManager().EmitEvent(
sdk.NewEvent(
types.EventTypeDenomTrace,
types.EventTypeDenom,
sdk.NewAttribute(types.AttributeKeyTraceHash, token.Denom.Hash().String()),
sdk.NewAttribute(types.AttributeKeyDenom, voucherDenom),
Copy link
Contributor

Choose a reason for hiding this comment

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

probably should update this to be token.Denom instead of voucherDenom, otherwise it's redundant

@DimitrisJim DimitrisJim force-pushed the carlos/rename-denomination_trace branch from 0469d96 to 58811c3 Compare June 5, 2024 08:17
sdk.NewAttribute(types.AttributeKeyTraceHash, traceHash),
sdk.NewAttribute(types.AttributeKeyDenom, voucherDenom),
types.EventTypeDenom,
sdk.NewAttribute(types.AttributeKeyDenomHash, token.Denom.Hash().String()),
Copy link
Contributor

Choose a reason for hiding this comment

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

also added this attribute to replace TraceHash one

@@ -28,7 +28,7 @@ slug: /apps/transfer/events
| fungible_token_packet | amount | \{amount\} |
| fungible_token_packet | success | \{ackSuccess\} |
| fungible_token_packet | memo | \{memo\} |
| denomination_trace | trace_hash | \{hex_hash\} |
| denomination | trace_hash | \{hex_hash\} |
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 am going to update this before merging.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0469d96 and 991a936.

Files selected for processing (4)
  • docs/docs/02-apps/01-transfer/05-events.md (1 hunks)
  • modules/apps/transfer/internal/events/events.go (1 hunks)
  • modules/apps/transfer/keeper/relay.go (1 hunks)
  • modules/apps/transfer/types/events.go (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • modules/apps/transfer/keeper/relay.go
  • modules/apps/transfer/types/events.go
Additional context used
Path-based instructions (2)
docs/docs/02-apps/01-transfer/05-events.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

modules/apps/transfer/internal/events/events.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

Markdownlint
docs/docs/02-apps/01-transfer/05-events.md

25-25: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


26-26: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


27-27: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


28-28: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


29-29: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


30-30: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


9-9: null (MD025, single-title, single-h1)
Multiple top-level headings in the same document

Additional comments not posted (2)
docs/docs/02-apps/01-transfer/05-events.md (1)

31-32: Update documentation to reflect new event type naming.

The documentation correctly reflects the renaming of denomination_trace to denomination. This aligns with the PR's objectives to simplify the event type name.

modules/apps/transfer/internal/events/events.go (1)

106-112: Update function to reflect new event type naming.

The function EmitDenomEvent correctly reflects the renaming of the event type from denomination_trace to denomination. This change is consistent with the PR's objectives and the function implementation is correct.

Copy link

sonarqubecloud bot commented Jun 5, 2024

Quality Gate Passed Quality Gate passed for 'ibc-go'

Issues
12 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@crodriguezvega crodriguezvega merged commit a5183be into main Jun 5, 2024
79 checks passed
@crodriguezvega crodriguezvega deleted the carlos/rename-denomination_trace branch June 5, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority PRs that need prompt reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants