Skip to content

Commit

Permalink
Merge pull request #31 from Plex-Engineer/sai/eng-1457-fix-data-for-c…
Browse files Browse the repository at this point in the history
…lientupdateproposal-in-canto-api

Fix ClientUpdate Proposal Data
  • Loading branch information
tkkwon1998 authored Jan 5, 2024
2 parents 494434e + 0840403 commit cb30d87
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions queryengine/native/proposals.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
gov "github.com/cosmos/cosmos-sdk/x/gov/types"
params "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
upgrade "github.com/cosmos/cosmos-sdk/x/upgrade/types"
clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
)

type BasicMetadata struct {
Expand Down Expand Up @@ -62,6 +63,13 @@ func GetProposalMetadata(content *types1.Any) (BasicMetadata, error) {
Title: metadata.GetTitle(),
Description: metadata.GetDescription(),
}, nil
case "/ibc.core.client.v1.ClientUpdateProposal":
var metadata clienttypes.ClientUpdateProposal
metadata.Unmarshal(content.Value)
return BasicMetadata{
Title: metadata.GetTitle(),
Description: metadata.GetDescription(),
}, nil
default:
return BasicMetadata{}, fmt.Errorf("Proposal type: %s not found", typeUrl)
}
Expand Down

0 comments on commit cb30d87

Please sign in to comment.