@@ -67,7 +67,8 @@ func TestApplyBlock(t *testing.T) {
6767 blockExec := sm .NewBlockExecutor (stateStore , log .TestingLogger (), proxyApp .Consensus (),
6868 mp , sm.EmptyEvidencePool {}, blockStore )
6969
70- block := makeBlock (state , 1 , new (types.Commit ))
70+ block , err := makeBlock (state , 1 , new (types.Commit ))
71+ require .NoError (t , err )
7172 bps , err := block .MakePartSet (testPartSize )
7273 require .NoError (t , err )
7374 blockID := types.BlockID {Hash : block .Hash (), PartSetHeader : bps .Header ()}
@@ -141,7 +142,8 @@ func TestFinalizeBlockDecidedLastCommit(t *testing.T) {
141142 }
142143
143144 // block for height 2
144- block := makeBlock (state , 2 , lastCommit .ToCommit ())
145+ block , err := makeBlock (state , 2 , lastCommit .ToCommit ())
146+ require .NoError (t , err )
145147 bps , err := block .MakePartSet (testPartSize )
146148 require .NoError (t , err )
147149 blockID := types.BlockID {Hash : block .Hash (), PartSetHeader : bps .Header ()}
@@ -221,7 +223,8 @@ func TestFinalizeBlockValidators(t *testing.T) {
221223 }
222224
223225 // block for height 2
224- block := makeBlock (state , 2 , lastCommit .ToCommit ())
226+ block , err := makeBlock (state , 2 , lastCommit .ToCommit ())
227+ require .NoError (t , err )
225228
226229 _ , err = sm .ExecCommitBlock (proxyApp .Consensus (), block , log .TestingLogger (), stateStore , 1 )
227230 require .NoError (t , err , tc .desc )
@@ -346,7 +349,8 @@ func TestFinalizeBlockMisbehavior(t *testing.T) {
346349 blockExec := sm .NewBlockExecutor (stateStore , log .TestingLogger (), proxyApp .Consensus (),
347350 mp , evpool , blockStore )
348351
349- block := makeBlock (state , 1 , new (types.Commit ))
352+ block , err := makeBlock (state , 1 , new (types.Commit ))
353+ require .NoError (t , err )
350354 block .Evidence = types.EvidenceData {Evidence : ev }
351355 block .EvidenceHash = block .Evidence .Hash ()
352356 bps , err := block .MakePartSet (testPartSize )
@@ -393,7 +397,8 @@ func TestProcessProposal(t *testing.T) {
393397 blockStore ,
394398 )
395399
396- block0 := makeBlock (state , height - 1 , new (types.Commit ))
400+ block0 , err := makeBlock (state , height - 1 , new (types.Commit ))
401+ require .NoError (t , err )
397402 lastCommitSig := []types.CommitSig {}
398403 partSet , err := block0 .MakePartSet (types .BlockPartSizeBytes )
399404 require .NoError (t , err )
@@ -416,10 +421,11 @@ func TestProcessProposal(t *testing.T) {
416421 lastCommitSig = append (lastCommitSig , vote .CommitSig ())
417422 }
418423
419- block1 := makeBlock (state , height , & types.Commit {
424+ block1 , err := makeBlock (state , height , & types.Commit {
420425 Height : height - 1 ,
421426 Signatures : lastCommitSig ,
422427 })
428+ require .NoError (t , err )
423429
424430 block1 .Txs = txs
425431
@@ -624,7 +630,8 @@ func TestFinalizeBlockValidatorUpdates(t *testing.T) {
624630 )
625631 require .NoError (t , err )
626632
627- block := makeBlock (state , 1 , new (types.Commit ))
633+ block , err := makeBlock (state , 1 , new (types.Commit ))
634+ require .NoError (t , err )
628635 bps , err := block .MakePartSet (testPartSize )
629636 require .NoError (t , err )
630637 blockID := types.BlockID {Hash : block .Hash (), PartSetHeader : bps .Header ()}
@@ -686,7 +693,8 @@ func TestFinalizeBlockValidatorUpdatesResultingInEmptySet(t *testing.T) {
686693 blockStore ,
687694 )
688695
689- block := makeBlock (state , 1 , new (types.Commit ))
696+ block , err := makeBlock (state , 1 , new (types.Commit ))
697+ require .NoError (t , err )
690698 bps , err := block .MakePartSet (testPartSize )
691699 require .NoError (t , err )
692700 blockID := types.BlockID {Hash : block .Hash (), PartSetHeader : bps .Header ()}
@@ -1031,26 +1039,26 @@ func TestCreateProposalAbsentVoteExtensions(t *testing.T) {
10311039 }{
10321040 {
10331041 name : "missing extension data on first required height" ,
1034- height : 2 ,
1035- extensionEnableHeight : 1 ,
1042+ height : 3 ,
1043+ extensionEnableHeight : 2 ,
10361044 expectPanic : true ,
10371045 },
10381046 {
10391047 name : "missing extension during before required height" ,
1040- height : 2 ,
1041- extensionEnableHeight : 2 ,
1048+ height : 3 ,
1049+ extensionEnableHeight : 3 ,
10421050 expectPanic : false ,
10431051 },
10441052 {
10451053 name : "missing extension data and not required" ,
1046- height : 2 ,
1054+ height : 3 ,
10471055 extensionEnableHeight : 0 ,
10481056 expectPanic : false ,
10491057 },
10501058 {
10511059 name : "missing extension data and required in two heights" ,
1052- height : 2 ,
1053- extensionEnableHeight : 3 ,
1060+ height : 3 ,
1061+ extensionEnableHeight : 4 ,
10541062 expectPanic : false ,
10551063 },
10561064 } {
@@ -1094,7 +1102,8 @@ func TestCreateProposalAbsentVoteExtensions(t *testing.T) {
10941102 sm.EmptyEvidencePool {},
10951103 blockStore ,
10961104 )
1097- block := makeBlock (state , testCase .height , new (types.Commit ))
1105+ block , err := makeBlock (state , testCase .height , new (types.Commit ))
1106+ require .NoError (t , err )
10981107
10991108 bps , err := block .MakePartSet (testPartSize )
11001109 require .NoError (t , err )
@@ -1104,7 +1113,8 @@ func TestCreateProposalAbsentVoteExtensions(t *testing.T) {
11041113 stripSignatures (lastCommit )
11051114 if testCase .expectPanic {
11061115 require .Panics (t , func () {
1107- blockExec .CreateProposalBlock (ctx , testCase .height , state , lastCommit , pa ) //nolint:errcheck
1116+ _ , err := blockExec .CreateProposalBlock (ctx , testCase .height , state , lastCommit , pa )
1117+ require .NoError (t , err )
11081118 })
11091119 } else {
11101120 _ , err = blockExec .CreateProposalBlock (ctx , testCase .height , state , lastCommit , pa )
0 commit comments