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

Extract addresses from all transactions and events #39

Merged
merged 6 commits into from
Nov 22, 2023

Conversation

wojtek-coreum
Copy link

@wojtek-coreum wojtek-coreum commented Nov 15, 2023

This change is Reviewable

@wojtek-coreum wojtek-coreum requested a review from a team as a code owner November 15, 2023 12:13
@wojtek-coreum wojtek-coreum requested review from dzmitryhil, miladz68, ysv and keyleu and removed request for a team November 15, 2023 12:13
Copy link

@ysv ysv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dzmitryhil, @keyleu, @miladz68, and @wojtek-coreum)


modules/group/account_parser.go line 28 at r1 (raw file):

		return addresses, nil
	case *group.MsgSubmitProposal:
		return []string{msg.GroupPolicyAddress}, nil

if we create a message inside the proposal e.g bank send and it has recipient
Will this tx be displayed on dest address also ? How does this work for authz.Exec ? I guess it will be the same here

dzmitryhil
dzmitryhil previously approved these changes Nov 15, 2023
Copy link

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 4 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @keyleu, @miladz68, and @wojtek-coreum)

miladz68
miladz68 previously approved these changes Nov 16, 2023
Copy link

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @keyleu and @wojtek-coreum)

Copy link
Author

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @keyleu and @ysv)


modules/group/account_parser.go line 28 at r1 (raw file):

Previously, ysv (Yaroslav Savchuk) wrote…

if we create a message inside the proposal e.g bank send and it has recipient
Will this tx be displayed on dest address also ? How does this work for authz.Exec ? I guess it will be the same here

Authz is handled by juno: https://github.com/forbole/juno/blob/v5.2.0/modules/messages/account_parser.go#L268
It supports built-in messages, but those created by us are not handled by default. We would have to fork juno and add our messages there or do it inside bdjuno.

Do we want to copy this logic and use it for groups? We might also wait until groups are supported natively, but then again - our custom messages won't be parsed.

Copy link

@ysv ysv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @keyleu and @wojtek-coreum)


modules/group/account_parser.go line 28 at r1 (raw file):

Previously, wojtek-coreum (Wojtek) wrote…

Authz is handled by juno: https://github.com/forbole/juno/blob/v5.2.0/modules/messages/account_parser.go#L268
It supports built-in messages, but those created by us are not handled by default. We would have to fork juno and add our messages there or do it inside bdjuno.

Do we want to copy this logic and use it for groups? We might also wait until groups are supported natively, but then again - our custom messages won't be parsed.

As we agreed on call lets have a single parser for all messages which goes through all events and fetches all address correct in terms of regexp and add them.
By the way as for regexp - maybe we can even improve it and try to use smth like sdk.ParseAccAddress ?

@wojtek-coreum wojtek-coreum dismissed stale reviews from miladz68 and dzmitryhil via 3ede61f November 17, 2023 11:05
Copy link
Author

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 2 of 7 files reviewed, 1 unresolved discussion (waiting on @dzmitryhil, @keyleu, @miladz68, and @ysv)


modules/group/account_parser.go line 28 at r1 (raw file):

Previously, ysv (Yaroslav Savchuk) wrote…

As we agreed on call lets have a single parser for all messages which goes through all events and fetches all address correct in terms of regexp and add them.
By the way as for regexp - maybe we can even improve it and try to use smth like sdk.ParseAccAddress ?

Done.

Copy link

@ysv ysv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 5 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @keyleu and @wojtek-coreum)


modules/group/handle_msg.go line 17 at r2 (raw file):

	switch cosmosMsg := msg.(type) {
	case *group.MsgExec,

as far as I understood from our discussion we decided to do this for literally all messges of cosmos sdk

Copy link
Author

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 2 of 8 files reviewed, 1 unresolved discussion (waiting on @keyleu and @ysv)


modules/group/handle_msg.go line 17 at r2 (raw file):

Previously, ysv (Yaroslav Savchuk) wrote…

as far as I understood from our discussion we decided to do this for literally all messges of cosmos sdk

Done.

ysv
ysv previously approved these changes Nov 20, 2023
Copy link

@ysv ysv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 6 of 6 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @keyleu)

Copy link

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @keyleu and @wojtek-coreum)


modules/group/account_parser.go line 3 at r3 (raw file):

package group

import (

Why do you need the group and other addresses parsers if you have one which parses everything?

Copy link
Author

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dzmitryhil and @keyleu)


modules/group/account_parser.go line 3 at r3 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

Why do you need the group and other addresses parsers if you have one which parses everything?

Because events might not covering everything. For example when group is created there is no event enumerating members.

Copy link

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @keyleu and @wojtek-coreum)


modules/group/account_parser.go line 3 at r3 (raw file):

Previously, wojtek-coreum (Wojtek) wrote…

Because events might not covering everything. For example when group is created there is no event enumerating members.

Right, that's why we should decode the message to JSON string, and use the same pattern as in events. So we won't need to update the message parsers for new messages as well.

Copy link
Author

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 5 of 9 files reviewed, 1 unresolved discussion (waiting on @dzmitryhil, @keyleu, @miladz68, and @ysv)


modules/group/account_parser.go line 3 at r3 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

Right, that's why we should decode the message to JSON string, and use the same pattern as in events. So we won't need to update the message parsers for new messages as well.

Done.

Copy link

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 5 of 9 files reviewed, 1 unresolved discussion (waiting on @keyleu, @miladz68, @wojtek-coreum, and @ysv)


cmd/bdjuno/main.go line 72 at r4 (raw file):

		assetft.MessagesParser,
		assetnft.MessagesParser,
		nft.MessagesParser,

Why do you still need those message parsers? Isn't it enough to have just one new?

Copy link
Author

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 5 of 12 files reviewed, 1 unresolved discussion (waiting on @dzmitryhil, @keyleu, @miladz68, and @ysv)


cmd/bdjuno/main.go line 72 at r4 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

Why do you still need those message parsers? Isn't it enough to have just one new?

Done.

…-module

# Conflicts:
#	modules/assetft/account_parser.go
#	modules/assetnft/account_parser.go
@dzmitryhil dzmitryhil requested review from miladz68 and ysv November 22, 2023 06:43
Copy link

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 5 of 12 files reviewed, all discussions resolved (waiting on @keyleu, @miladz68, and @ysv)

Copy link

@ysv ysv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 4 files at r4, 4 of 4 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @keyleu and @miladz68)

@wojtek-coreum wojtek-coreum changed the title Install group module Extract addresses from all transactions and events Nov 22, 2023
@wojtek-coreum wojtek-coreum merged commit 9cadd6d into chains/coreum Nov 22, 2023
2 checks passed
@wojtek-coreum wojtek-coreum deleted the wojtek/group-module branch November 22, 2023 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants