Skip to content

Commit

Permalink
fix & test stringer
Browse files Browse the repository at this point in the history
  • Loading branch information
pirtleshell committed Apr 18, 2023
1 parent c51dd47 commit b6ecba9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/community/types/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ func (p *CommunityCDPRepayDebtProposal) ProposalType() string {
// String implements fmt.Stringer
func (p *CommunityCDPRepayDebtProposal) String() string {
var b strings.Builder
b.WriteString(fmt.Sprintf(`Community Pool Lend Deposit Proposal:
b.WriteString(fmt.Sprintf(`Community CDP Repay Debt Proposal:
Title: %s
Description: %s
Collateral Type: %s
Payment: %s
Payment: %s
`, p.Title, p.Description, p.CollateralType, p.Payment))
return b.String()
}
Expand Down
15 changes: 15 additions & 0 deletions x/community/types/proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,18 @@ func TestCommunityCDPRepayDebtProposal_ValidateBasic(t *testing.T) {
})
}
}

func TestCommunityCDPRepayDebtProposal_Stringer(t *testing.T) {
proposal := types.NewCommunityCDPRepayDebtProposal(
"title",
"description",
"collateral-type",
sdk.NewInt64Coin("ukava", 42),
)
require.Equal(t, `Community CDP Repay Debt Proposal:
Title: title
Description: description
Collateral Type: collateral-type
Payment: 42ukava
`, proposal.String())
}

0 comments on commit b6ecba9

Please sign in to comment.