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

about event type message inside x/bank #17269

Closed
0Tech opened this issue Aug 3, 2023 · 4 comments · Fixed by #17273
Closed

about event type message inside x/bank #17269

0Tech opened this issue Aug 3, 2023 · 4 comments · Fixed by #17273

Comments

@0Tech
Copy link
Contributor

0Tech commented Aug 3, 2023

Looking around #13532, which I think is a nice refactoring, I found some events left behind.

sdk.NewEvent(
sdk.EventTypeMessage,
sdk.NewAttribute(types.AttributeKeySender, input.Address),
),

sdk.NewEvent(
sdk.EventTypeMessage,
sdk.NewAttribute(types.AttributeKeySender, fromAddr.String()),
),

I'm not sure whether it is a bug or not. Is it intentional, like for the backward-compatibility? Or it would be better to remove them.

@julienrbrt
Copy link
Member

julienrbrt commented Aug 3, 2023

The PR you mentioned only removed events from the message server. These two snippets are from bank keeper. As those functions can be and are used by modules, we could be losing information.

@0Tech
Copy link
Contributor Author

0Tech commented Aug 3, 2023

One can get the sender information in the both cases.

In the first case, InputOutputCoins() is only called from the x/bank's message server, so the sender would be input[0] of MsgMultiSend. In the second case, the corresponding transfer event contains it, so it would be obvious.

As those functions can be and are used by modules

I agree. However, other modules are already using its message server, e.g. x/authz and x/group. So we are losing the information by the PR, technically. So if there is no strict requirement on it, maybe we can consider removing it from the keeper too.

@julienrbrt julienrbrt reopened this Aug 3, 2023
@julienrbrt
Copy link
Member

This makes sense to me! Do you want to open a PR?

@0Tech
Copy link
Contributor Author

0Tech commented Aug 3, 2023

Thank you! I will submit the corresponding PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants