Skip to content

Commit

Permalink
fix: Allow underscores in EventRegex (backport #13861) (#13864)
Browse files Browse the repository at this point in the history
* fix: Allow underscores in EventRegex (#13861)

(cherry picked from commit 14c582f)

# Conflicts:
#	CHANGELOG.md
#	tests/e2e/tx/service_test.go

* updates

* updates

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
  • Loading branch information
3 people committed Nov 15, 2022
1 parent 2114ec4 commit 2d515e0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
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
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
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

0 comments on commit 2d515e0

Please sign in to comment.