fix: Allow underscores in EventRegex (#13861)

This commit is contained in:
Aleksandr Bezobchuk 2022-11-14 13:49:59 -05:00 committed by GitHub
parent 81209e688a
commit 14c582f30e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -186,7 +186,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/gov) [#13045](https://github.com/cosmos/cosmos-sdk/pull/13045) Fix gov migrations for v3(0.46).
* (snapshot) [#13400](https://github.com/cosmos/cosmos-sdk/pull/13400) Fix snapshot checksum issue in golang 1.19.
* (x/gov) [#13728](https://github.com/cosmos/cosmos-sdk/pull/13728) Fix propagation of message events to the current context in `EndBlocker`.
* (server) [#13778](https://github.com/cosmos/cosmos-sdk/pull/13778) Set Cosmos SDK default endpoints to localhost to avoid unknown exposure of endpoints.
* (server) [#13778](https://github.com/cosmos/cosmos-sdk/pull/13778) Set Cosmos SDK default endpoints to localhost to avoid unknown exposure of endpoints.
* [#13861](https://github.com/cosmos/cosmos-sdk/pull/13861) Allow `_` characters in tx event queries, i.e. `GetTxsEvent`.
### Deprecated

View File

@ -161,6 +161,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",

View File

@ -44,7 +44,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 (