Skip to content

Commit 66bebf2

Browse files
authored
fix: add omitempty in governance (#63)
1 parent c064530 commit 66bebf2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

schema/metadata/governance.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ func (t GovernanceProposal) Type() schema.Type {
1313

1414
type GovernanceProposal struct {
1515
ID string `json:"id"`
16-
Body string `json:"body"`
17-
StartBlock string `json:"start_block"`
18-
EndBlock string `json:"end_block"`
19-
Options []string `json:"options"`
20-
Link string `json:"link"`
16+
Body string `json:"body,omitempty"`
17+
StartBlock string `json:"start_block,omitempty"`
18+
EndBlock string `json:"end_block,omitempty"`
19+
Options []string `json:"options,omitempty"`
20+
Link string `json:"link,omitempty"`
2121
}
2222

2323
var _ Metadata = (*GovernanceVote)(nil)
@@ -33,8 +33,8 @@ var _ Metadata = (*GovernanceVoteAction)(nil)
3333

3434
type GovernanceVote struct {
3535
Action GovernanceVoteAction `json:"action"`
36-
Count uint64 `json:"count"`
37-
Reason string `json:"reason"`
36+
Count uint64 `json:"count,omitempty"`
37+
Reason string `json:"reason,omitempty"`
3838
Proposal GovernanceProposal `json:"token"`
3939
}
4040

0 commit comments

Comments
 (0)