duality-labs / duality

Apache License 2.0
10 stars 5 forks source link

Rename event attribute keys to match event query regex #445

Closed dib542 closed 1 year ago

dib542 commented 1 year ago

To search chain transactions: event queries in the form {eventType}.{eventAttribute}={value} are used in the services:

The format of expected event queries from our current CosmosSDK usage (v0.47.3) is ^[a-zA-Z_]+\.[a-zA-Z_]+=\S+$ as defined in https://github.com/cosmos/cosmos-sdk/blob/v0.47.3/x/auth/tx/service.go#L48

Some of our current eventAttribute keys do not match this regex format ([a-zA-Z_]+) and so queries using these keys are rejected with an "incorrect format" error.

This fix was not needed prior to CosmosSDK 0.47.x because this check has only been asserted since CosmosSDK v0.47.0: https://github.com/cosmos/cosmos-sdk/commit/18da0e9c15e0210fdd289e3f1f0f5fefe3f6b72a#diff-53f84248611b4e705fd4106d3f6f46eed9258656b0b3db22bd56fdde5628cebdR47

This PR changes those event attribute keys to match the expected regex format. I've checked through our modules events.go and keys.go files and all the events in the dex, incentives, epochs pass the regex.