@@ -87,10 +87,11 @@ func TestTickExpiredDepositPeriod(t *testing.T) {
87
87
ctx := app .BaseApp .NewContext (false )
88
88
addrs := simtestutil .AddTestAddrs (suite .BankKeeper , suite .StakingKeeper , ctx , 10 , valTokens )
89
89
90
- app .FinalizeBlock (& abci.RequestFinalizeBlock {
90
+ _ , err := app .FinalizeBlock (& abci.RequestFinalizeBlock {
91
91
Height : app .LastBlockHeight () + 1 ,
92
92
Hash : app .LastCommitID ().Hash ,
93
93
})
94
+ require .NoError (t , err )
94
95
95
96
govMsgSvr := keeper .NewMsgServerImpl (suite .GovKeeper )
96
97
@@ -138,10 +139,11 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) {
138
139
ctx := app .BaseApp .NewContext (false )
139
140
addrs := simtestutil .AddTestAddrs (suite .BankKeeper , suite .StakingKeeper , ctx , 10 , valTokens )
140
141
141
- app .FinalizeBlock (& abci.RequestFinalizeBlock {
142
+ _ , err := app .FinalizeBlock (& abci.RequestFinalizeBlock {
142
143
Height : app .LastBlockHeight () + 1 ,
143
144
Hash : app .LastCommitID ().Hash ,
144
145
})
146
+ require .NoError (t , err )
145
147
146
148
govMsgSvr := keeper .NewMsgServerImpl (suite .GovKeeper )
147
149
@@ -209,10 +211,11 @@ func TestTickPassedDepositPeriod(t *testing.T) {
209
211
ctx := app .BaseApp .NewContext (false )
210
212
addrs := simtestutil .AddTestAddrs (suite .BankKeeper , suite .StakingKeeper , ctx , 10 , valTokens )
211
213
212
- app .FinalizeBlock (& abci.RequestFinalizeBlock {
214
+ _ , err := app .FinalizeBlock (& abci.RequestFinalizeBlock {
213
215
Height : app .LastBlockHeight () + 1 ,
214
216
Hash : app .LastCommitID ().Hash ,
215
217
})
218
+ require .NoError (t , err )
216
219
217
220
govMsgSvr := keeper .NewMsgServerImpl (suite .GovKeeper )
218
221
@@ -274,10 +277,11 @@ func TestTickPassedVotingPeriod(t *testing.T) {
274
277
275
278
SortAddresses (addrs )
276
279
277
- app .FinalizeBlock (& abci.RequestFinalizeBlock {
280
+ _ , err := app .FinalizeBlock (& abci.RequestFinalizeBlock {
278
281
Height : app .LastBlockHeight () + 1 ,
279
282
Hash : app .LastCommitID ().Hash ,
280
283
})
284
+ require .NoError (t , err )
281
285
282
286
govMsgSvr := keeper .NewMsgServerImpl (suite .GovKeeper )
283
287
@@ -368,16 +372,18 @@ func TestProposalPassedEndblocker(t *testing.T) {
368
372
govMsgSvr := keeper .NewMsgServerImpl (suite .GovKeeper )
369
373
stakingMsgSvr := stakingkeeper .NewMsgServerImpl (suite .StakingKeeper )
370
374
371
- app .FinalizeBlock (& abci.RequestFinalizeBlock {
375
+ _ , err := app .FinalizeBlock (& abci.RequestFinalizeBlock {
372
376
Height : app .LastBlockHeight () + 1 ,
373
377
Hash : app .LastCommitID ().Hash ,
374
378
})
379
+ require .NoError (t , err )
375
380
376
381
valAddr := sdk .ValAddress (addrs [0 ])
377
382
proposer := addrs [0 ]
378
383
379
384
createValidators (t , stakingMsgSvr , ctx , []sdk.ValAddress {valAddr }, []int64 {10 })
380
- suite .StakingKeeper .EndBlocker (ctx )
385
+ _ , err = suite .StakingKeeper .EndBlocker (ctx )
386
+ require .NoError (t , err )
381
387
382
388
macc := suite .GovKeeper .GetGovernanceAccount (ctx )
383
389
require .NotNil (t , macc )
@@ -408,7 +414,8 @@ func TestProposalPassedEndblocker(t *testing.T) {
408
414
newHeader .Time = ctx .BlockHeader ().Time .Add (* params .MaxDepositPeriod ).Add (* params .VotingPeriod )
409
415
ctx = ctx .WithBlockHeader (newHeader )
410
416
411
- gov .EndBlocker (ctx , suite .GovKeeper )
417
+ err = gov .EndBlocker (ctx , suite .GovKeeper )
418
+ require .NoError (t , err )
412
419
413
420
macc = suite .GovKeeper .GetGovernanceAccount (ctx )
414
421
require .NotNil (t , macc )
@@ -427,16 +434,18 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) {
427
434
428
435
stakingMsgSvr := stakingkeeper .NewMsgServerImpl (suite .StakingKeeper )
429
436
430
- app .FinalizeBlock (& abci.RequestFinalizeBlock {
437
+ _ , err := app .FinalizeBlock (& abci.RequestFinalizeBlock {
431
438
Height : app .LastBlockHeight () + 1 ,
432
439
Hash : app .LastCommitID ().Hash ,
433
440
})
441
+ require .NoError (t , err )
434
442
435
443
valAddr := sdk .ValAddress (addrs [0 ])
436
444
proposer := addrs [0 ]
437
445
438
446
createValidators (t , stakingMsgSvr , ctx , []sdk.ValAddress {valAddr }, []int64 {10 })
439
- suite .StakingKeeper .EndBlocker (ctx )
447
+ _ , err = suite .StakingKeeper .EndBlocker (ctx )
448
+ require .NoError (t , err )
440
449
441
450
msg := banktypes .NewMsgSend (authtypes .NewModuleAddress (types .ModuleName ), addrs [0 ], sdk .NewCoins (sdk .NewCoin (sdk .DefaultBondDenom , math .NewInt (100000 ))))
442
451
proposal , err := suite .GovKeeper .SubmitProposal (ctx , []sdk.Msg {msg }, "" , "title" , "summary" , proposer , false )
@@ -459,7 +468,8 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) {
459
468
ctx = ctx .WithBlockHeader (newHeader )
460
469
461
470
// validate that the proposal fails/has been rejected
462
- gov .EndBlocker (ctx , suite .GovKeeper )
471
+ err = gov .EndBlocker (ctx , suite .GovKeeper )
472
+ require .NoError (t , err )
463
473
464
474
// check proposal events
465
475
events := ctx .EventManager ().Events ()
@@ -511,17 +521,19 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) {
511
521
govMsgSvr := keeper .NewMsgServerImpl (suite .GovKeeper )
512
522
stakingMsgSvr := stakingkeeper .NewMsgServerImpl (suite .StakingKeeper )
513
523
514
- app .FinalizeBlock (& abci.RequestFinalizeBlock {
524
+ _ , err = app .FinalizeBlock (& abci.RequestFinalizeBlock {
515
525
Height : app .LastBlockHeight () + 1 ,
516
526
Hash : app .LastCommitID ().Hash ,
517
527
})
528
+ require .NoError (t , err )
518
529
519
530
valAddr := sdk .ValAddress (addrs [0 ])
520
531
proposer := addrs [0 ]
521
532
522
533
// Create a validator so that able to vote on proposal.
523
534
createValidators (t , stakingMsgSvr , ctx , []sdk.ValAddress {valAddr }, []int64 {10 })
524
- suite .StakingKeeper .EndBlocker (ctx )
535
+ _ , err = suite .StakingKeeper .EndBlocker (ctx )
536
+ require .NoError (t , err )
525
537
526
538
checkInactiveProposalsQueue (t , ctx , suite .GovKeeper )
527
539
checkActiveProposalsQueue (t , ctx , suite .GovKeeper )
@@ -571,7 +583,8 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) {
571
583
}
572
584
573
585
// Here the expedited proposal is converted to regular after expiry.
574
- gov .EndBlocker (ctx , suite .GovKeeper )
586
+ err = gov .EndBlocker (ctx , suite .GovKeeper )
587
+ require .NoError (t , err )
575
588
576
589
if tc .expeditedPasses {
577
590
checkActiveProposalsQueue (t , ctx , suite .GovKeeper )
@@ -626,7 +639,8 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) {
626
639
}
627
640
628
641
// Here we validate the converted regular proposal
629
- gov .EndBlocker (ctx , suite .GovKeeper )
642
+ err = gov .EndBlocker (ctx , suite .GovKeeper )
643
+ require .NoError (t , err )
630
644
631
645
macc = suite .GovKeeper .GetGovernanceAccount (ctx )
632
646
require .NotNil (t , macc )
@@ -661,6 +675,7 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) {
661
675
}
662
676
663
677
func createValidators (t * testing.T , stakingMsgSvr stakingtypes.MsgServer , ctx sdk.Context , addrs []sdk.ValAddress , powerAmt []int64 ) {
678
+ t .Helper ()
664
679
require .True (t , len (addrs ) <= len (pubkeys ), "Not enough pubkeys specified at top of file." )
665
680
666
681
for i := 0 ; i < len (addrs ); i ++ {
@@ -688,6 +703,7 @@ func getDepositMultiplier(expedited bool) int64 {
688
703
}
689
704
690
705
func checkActiveProposalsQueue (t * testing.T , ctx sdk.Context , k * keeper.Keeper ) {
706
+ t .Helper ()
691
707
err := k .ActiveProposalsQueue .Walk (ctx , collections.NewPrefixUntilPairRange [time.Time , uint64 ](ctx .BlockTime ()), func (key collections.Pair [time.Time , uint64 ], value uint64 ) (stop bool , err error ) {
692
708
return false , err
693
709
})
@@ -696,6 +712,7 @@ func checkActiveProposalsQueue(t *testing.T, ctx sdk.Context, k *keeper.Keeper)
696
712
}
697
713
698
714
func checkInactiveProposalsQueue (t * testing.T , ctx sdk.Context , k * keeper.Keeper ) {
715
+ t .Helper ()
699
716
err := k .InactiveProposalsQueue .Walk (ctx , collections.NewPrefixUntilPairRange [time.Time , uint64 ](ctx .BlockTime ()), func (key collections.Pair [time.Time , uint64 ], value uint64 ) (stop bool , err error ) {
700
717
return false , err
701
718
})
0 commit comments