-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
EmitTypedEvent Escapes Strings #12592
Comments
So these events are emitted using the new typed-events approach, as you can see here: return ctx.EventManager().EmitTypedEvent(&authz.EventGrant{
MsgTypeUrl: authorization.MsgTypeURL(),
Granter: granter.String(),
Grantee: grantee.String(),
}) I don't see anything special about encoding or anything like that here. So this has nothing to do with Do you have a tx hash as an example that I can look at on the Hub? @aaronc @AmauryM Do you know if this is due to Proto encoding when calling |
You can basically use any grant tx e.g. related to the restake app. I'm not too deep in the current cosmos-sdk, but had a look also in the prtotobuf part, compared it to what others do, but could not spot a difference, e.g. the cosmos-sdk/proto/cosmos/authz/v1beta1/ vs. bank/v1beta1. What i however know is that there is a bug in authz related to JSON representation (however leading to elevate the whole data 1 level, and seems unrelated to me: https://medium.com/confio/authz-and-ledger-signing-an-executive-summary-8754a0dc2a88) |
That's the way how it's done now: in The proposed solution back then was to have a SDK engine for querying events (maybe even store them in state, or not, TBD). But for now, I guess if you want to use TM to query txs, you would need to query with |
Ok, so the point from #7762 (comment) is So we are now left with the situation that the authz transactions can not be queried based on garnter grantee fields for some time. |
I recall there was a PR recently to event querying to allow |
As stated above:
so it works with newer versions of the daemons, these are however not yet listed in the chain registry as recommended/compatible versions. I wonder why do the other events still emit without "? Will this change after update or will this only change for newer modules / modules actively altered for this? |
That's because only some modules use |
Im not sure if there is an actionable as part of this issue other than migrate more modules to use typed events. We also have started emitting our own events with the adoption of adr 38. users can use that to avoid some tendermint related issues, closing this issue, since the migration of more modules to use typed events is captured in an other issue |
Summary of Bug
C:x/authz module uses extra " around value fields in events for grant transactions, e.g. granter, grantee, msg_type_url, which results in query results as e.g.:
which however should be
I could not find a related bug report.
Version
current main branch head, commit 01b4a42
Steps to Reproduce
issue a grant tx
./simd tx authz grant $(./simd keys show b9lab -a) generic --msg-type /cosmos.staking.v1beta1.MsgDelegate --from student --chain-id test-chain
and simd query tx hash it
For Admin Use
The text was updated successfully, but these errors were encountered: