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: Allow underscores in EventRegex (backport #13861) #13864

Merged
merged 3 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

## [v0.46.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.5) - 2022-11-14
## [v0.46.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.5) - 2022-11-16

### Improvements

Expand All @@ -49,7 +49,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/bank) [#13821](https://github.com/cosmos/cosmos-sdk/pull/13821) Fix bank store migration of coin metadata.
* (x/group) [#13808](https://github.com/cosmos/cosmos-sdk/pull/13808) Fix propagation of message events to the current context in `EndBlocker`.
* (x/gov) [#13728](https://github.com/cosmos/cosmos-sdk/pull/13728) Fix propagation of message events to the current context in `EndBlocker`.
* (store) [#13803](https://github.com/cosmos/cosmos-sdk/pull/13803) Add an error log if iavl set operation failed.
* (store) [#13803](https://github.com/cosmos/cosmos-sdk/pull/13803) Add an error log if IAVL set operation failed.
* [#13861](https://github.com/cosmos/cosmos-sdk/pull/13861) Allow `_` characters in tx event queries, i.e. `GetTxsEvent`.

## [v0.46.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.4) - 2022-11-01

Expand Down
2 changes: 1 addition & 1 deletion x/auth/tx/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var (
_ txtypes.ServiceServer = txServer{}

// EventRegex checks that an event string is formatted with {alphabetic}.{alphabetic}={value}
EventRegex = regexp.MustCompile(`^[a-zA-Z]+\.[a-zA-Z]+=\S+$`)
EventRegex = regexp.MustCompile(`^[a-zA-Z_]+\.[a-zA-Z_]+=\S+$`)
)

const (
Expand Down
5 changes: 5 additions & 0 deletions x/auth/tx/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ func TestEventRegex(t *testing.T) {
event: "tx.message='something'",
match: true,
},
{
name: "valid: with underscores",
event: "claim_reward.message_action='something'",
match: true,
},
{
name: "valid: no quotes",
event: "tx.message=something",
Expand Down