Skip to content

Commit 5ce0b95

Browse files
committed
Add title and summary parser for cosmos.gov.v1.MsgSubmitProposal
1 parent d14b561 commit 5ce0b95

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

projection/proposal/proposal.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ func (projection *Proposal) HandleEvents(height int64, events []event_entity.Eve
501501
depositEndTime := blockTime.Add(context.maxDepositPeriod)
502502
row := view.ProposalRow{
503503
ProposalId: *msgSubmitProposal.MaybeProposalId,
504-
Title: "",
505-
Description: "",
504+
Title: msgSubmitProposal.Title,
505+
Description: msgSubmitProposal.Description,
506506
Type: msgSubmitProposal.MsgType(),
507507
Status: view.PROPOSAL_STATUS_DEPOSIT_PERIOD,
508508
ProposerAddress: msgSubmitProposal.Proposer,

usecase/model/gov/v1/msg_submit_proposal.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ type RawMsgSubmitProposal struct {
1010
Proposer string `json:"proposer"`
1111
InitialDeposit []interface{} `mapstructure:"initial_deposit" json:"initial_deposit"`
1212
Metadata string `json:"metadata"`
13+
Title string `json:"title"`
14+
Summary string `json:"summary"`
1315
}
1416
type MsgSubmitProposalMsg struct {
1517
Type string `mapstructure:"@type" json:"@type"`
@@ -20,5 +22,7 @@ type MsgSubmitProposalParams struct {
2022
Messages []interface{} `json:"messages"`
2123
InitialDeposit coin.Coins `json:"initial_deposit"`
2224
Proposer string `json:"proposer"`
25+
Title string `json:"title"`
26+
Description string `json:"description"`
2327
Metadata string `json:"metadata"`
2428
}

usecase/parser/gov/v1/msg.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ func ParseMsgSubmitProposal(
163163
Messages: rawMsg.Messages,
164164
InitialDeposit: initialDepositAmount,
165165
Proposer: rawMsg.Proposer,
166+
Title: rawMsg.Title,
167+
Description: rawMsg.Summary,
166168
Metadata: rawMsg.Metadata,
167169
},
168170
)}, possibleSignerAddresses
@@ -212,6 +214,8 @@ func ParseMsgSubmitProposal(
212214
Messages: rawMsg.Messages,
213215
InitialDeposit: initialDepositAmount,
214216
Proposer: rawMsg.Proposer,
217+
Title: rawMsg.Title,
218+
Description: rawMsg.Summary,
215219
Metadata: rawMsg.Metadata,
216220
},
217221
),

0 commit comments

Comments
 (0)