@@ -1478,6 +1478,37 @@ func (suite *KeeperTestSuite) TestGRPCQueryTallyResult() {
14781478 },
14791479 true ,
14801480 },
1481+ {
1482+ "proposal status failed" ,
1483+ func () {
1484+ propTime := time .Now ()
1485+ proposal := v1.Proposal {
1486+ Id : 1 ,
1487+ Status : v1 .StatusFailed ,
1488+ FinalTallyResult : & v1.TallyResult {
1489+ YesCount : "4" ,
1490+ AbstainCount : "1" ,
1491+ NoCount : "0" ,
1492+ NoWithVetoCount : "0" ,
1493+ },
1494+ SubmitTime : & propTime ,
1495+ VotingStartTime : & propTime ,
1496+ VotingEndTime : & propTime ,
1497+ Metadata : "proposal metadata" ,
1498+ }
1499+ suite .govKeeper .SetProposal (suite .ctx , proposal )
1500+
1501+ req = & v1.QueryTallyResultRequest {ProposalId : proposal .Id }
1502+
1503+ expTally = & v1.TallyResult {
1504+ YesCount : "4" ,
1505+ AbstainCount : "1" ,
1506+ NoCount : "0" ,
1507+ NoWithVetoCount : "0" ,
1508+ }
1509+ },
1510+ true ,
1511+ },
14811512 }
14821513
14831514 for _ , testCase := range testCases {
@@ -1614,6 +1645,37 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTallyResult() {
16141645 },
16151646 true ,
16161647 },
1648+ {
1649+ "proposal status failed" ,
1650+ func () {
1651+ propTime := time .Now ()
1652+ proposal := v1.Proposal {
1653+ Id : 1 ,
1654+ Status : v1 .StatusFailed ,
1655+ FinalTallyResult : & v1.TallyResult {
1656+ YesCount : "4" ,
1657+ AbstainCount : "1" ,
1658+ NoCount : "0" ,
1659+ NoWithVetoCount : "0" ,
1660+ },
1661+ SubmitTime : & propTime ,
1662+ VotingStartTime : & propTime ,
1663+ VotingEndTime : & propTime ,
1664+ Metadata : "proposal metadata" ,
1665+ }
1666+ suite .govKeeper .SetProposal (suite .ctx , proposal )
1667+
1668+ req = & v1beta1.QueryTallyResultRequest {ProposalId : proposal .Id }
1669+
1670+ expTally = & v1beta1.TallyResult {
1671+ Yes : math .NewInt (4 ),
1672+ Abstain : math .NewInt (1 ),
1673+ No : math .NewInt (0 ),
1674+ NoWithVeto : math .NewInt (0 ),
1675+ }
1676+ },
1677+ true ,
1678+ },
16171679 }
16181680
16191681 for _ , testCase := range testCases {
0 commit comments