@@ -186,9 +186,31 @@ func (suite *KeeperTestSuite) TestSetToDistribute() {
186186 distrBal := sdk .NewCoins (sdk .NewCoin (sdk .DefaultBondDenom , math .NewInt (1000000 )))
187187 suite .bankKeeper .EXPECT ().GetAllBalances (suite .ctx , poolDistrAcc .GetAddress ()).Return (distrBal ).AnyTimes ()
188188
189+ // because there are no continuous funds, all are going to the community pool
190+ suite .bankKeeper .EXPECT ().SendCoinsFromModuleToModule (suite .ctx , poolDistrAcc .GetName (), poolAcc .GetName (), distrBal )
191+
189192 err := suite .poolKeeper .SetToDistribute (suite .ctx )
190193 suite .Require ().NoError (err )
191194
195+ // Verify that LastBalance was not set (zero balance)
196+ _ , err = suite .poolKeeper .LastBalance .Get (suite .ctx )
197+ suite .Require ().ErrorContains (err , "not found" )
198+
199+ // create new continuous fund and distribute again
200+ addrCdc := address .NewBech32Codec ("cosmos" )
201+ addrStr := "cosmos1qypq2q2l8z4wz2z2l8z4wz2z2l8z4wz2srklj6"
202+ addrBz , err := addrCdc .StringToBytes (addrStr )
203+ suite .Require ().NoError (err )
204+
205+ suite .poolKeeper .ContinuousFund .Set (suite .ctx , addrBz , types.ContinuousFund {
206+ Recipient : addrStr ,
207+ Percentage : math .LegacyMustNewDecFromStr ("0.3" ),
208+ Expiry : nil ,
209+ })
210+
211+ err = suite .poolKeeper .SetToDistribute (suite .ctx )
212+ suite .Require ().NoError (err )
213+
192214 // Verify that LastBalance was set correctly
193215 lastBalance , err := suite .poolKeeper .LastBalance .Get (suite .ctx )
194216 suite .Require ().NoError (err )
0 commit comments