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: do not flatten events attributes by event types #14691

Merged
merged 6 commits into from
Jan 19, 2023
Merged

Conversation

julienrbrt
Copy link
Member

Description

Closes: #14015


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)

@julienrbrt julienrbrt marked this pull request as ready for review January 19, 2023 10:11
@julienrbrt julienrbrt requested a review from a team as a code owner January 19, 2023 10:11
@github-prbot github-prbot requested review from a team, aaronc and atheeshp and removed request for a team January 19, 2023 10:12
@@ -671,7 +671,7 @@ func BenchmarkLegacyQuoRoundupMut(b *testing.B) {
func TestFormatDec(t *testing.T) {
type decimalTest []string
var testcases []decimalTest
raw, err := os.ReadFile("../tx/textual/internal/testdata/decimals.json")
raw, err := os.ReadFile("../x/tx/textual/internal/testdata/decimals.json")
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated to this PR, but I think it does not need another PR to be fixed.
Noticed it was failing while running make test: due to #14634

CHANGELOG.md Outdated
@@ -72,6 +72,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Improvements

* [#14691](https://github.com/cosmos/cosmos-sdk/pull/14691) Change behavior of `sdk.StringifyEvents` to do not flatten events attributes by events type.
Copy link
Member Author

Choose a reason for hiding this comment

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

Are log used in the state machine?

Copy link
Member

Choose a reason for hiding this comment

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

I think it is worth mentioning that this only affects the Log string of the tx execution result, not the Events

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, is it okay to include in a point version, then? Or better directly in v0.47?
Someone could query the logs and store it right?

Copy link
Member

Choose a reason for hiding this comment

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

If you ask me, this does not belong in a patch release. I think clients also deserve stable interfaces.

Copy link
Member Author

Choose a reason for hiding this comment

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

If you ask me, this does not belong in a patch release. I think clients also deserve stable interfaces.

Didn't think about that sorry. Yeah, that makes sense then.

Copy link
Member

Choose a reason for hiding this comment

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

👍 Having it in the 0.47 upgrade is great. I'd assume some clients adapted to the current behaviour (as you can see by the comments explaining how to split the merged events into individual events by counting positions). I doubt this change is urgent.

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

LGTM but I'm not familiar with this codebase

CHANGELOG.md Outdated
@@ -72,6 +72,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Improvements

* [#14691](https://github.com/cosmos/cosmos-sdk/pull/14691) Change behavior of `sdk.StringifyEvents` to do not flatten events attributes by events type.
Copy link
Member

Choose a reason for hiding this comment

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

I think it is worth mentioning that this only affects the Log string of the tx execution result, not the Events

CHANGELOG.md Outdated
@@ -72,6 +72,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Improvements

* [#14691](https://github.com/cosmos/cosmos-sdk/pull/14691) Change behavior of `sdk.StringifyEvents` to do not flatten events attributes by events type.
Copy link
Contributor

Choose a reason for hiding this comment

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

CHANGELOG.md Outdated Show resolved Hide resolved
julienrbrt and others added 3 commits January 19, 2023 20:03
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
@julienrbrt julienrbrt enabled auto-merge (squash) January 19, 2023 19:21
@julienrbrt julienrbrt merged commit d5d39c0 into main Jan 19, 2023
@julienrbrt julienrbrt deleted the julien/events branch January 19, 2023 19:42
@julienrbrt
Copy link
Member Author

@Mergifyio backport release/v0.47.x

mergify bot pushed a commit that referenced this pull request Jan 19, 2023
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
(cherry picked from commit d5d39c0)

# Conflicts:
#	CHANGELOG.md
@mergify
Copy link
Contributor

mergify bot commented Jan 19, 2023

backport release/v0.47.x

✅ Backports have been created

tac0turtle pushed a commit that referenced this pull request Jan 20, 2023
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.

Multiple events are merged into one in transactin result log
3 participants