forbole / callisto

Callisto (formerly BDJuno) is the official Juno implementation for Big Dipper, the open-source block explorer for Cosmos
https://bigdipper.live
MIT License
91 stars 249 forks source link

fix: re-add support for gov v1beta1 messages #725

Closed dadamu closed 7 months ago

dadamu commented 8 months ago

Description

Closes: #XXXX Currently, gov module is updated to gov v1, however, gov v1beta1 is still alive to chains, Cosmos-SDK doesn't completely remove v1beta1 support. As a result, we should re-add gov v1beta1 support to make sure our proposals data are also updated when gov v1beta1 messages are performed.

Say, some of users on Cheqd is using gov.v1beta1.MsgVote to vote on the proposal. https://bigdipper.live/cheqd/transactions/19E4F068FBFBC46DA9BEF3E0F7CA908317D5582CAB2A17683138A5248ED34E3C


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.

I have...

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.

I have...

dadamu commented 8 months ago

@0x7u

We are not able to use provided methods like:

Unluckily, the thing I tried is to parse the string from event, and it shows two cases in Cosmos-SDK now. The option value string is from: https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/x/gov/types/v1beta1/vote.go#L66 https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/x/gov/types/v1/gov.pb.go#L133

There is no function supporting to parse string into option and also WeightOptionsFromString couldn't parse these option string properly since it is used for cmd string.

Therefore we can only parse them by ourselves. If we handle message instance directly, then we need to have both functions, v1 and v1beta1 for each gov messages.

0x7u commented 8 months ago

@0x7u

We are not able to use provided methods like:

Unluckily, the thing I tried is to parse the string from event, and it shows two cases in Cosmos-SDK now. The option value string is from: https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/x/gov/types/v1beta1/vote.go#L66 https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/x/gov/types/v1/gov.pb.go#L133

There is no function supporting to parse string into option and also WeightOptionsFromString couldn't parse these option string properly since it is used for cmd string.

Therefore we can only parse them by ourselves. If we handle message instance directly, then we need to have both functions, v1 and v1beta1 for each gov messages.

Very interesting.