@@ -66,7 +66,8 @@ func TestApplyBlock(t *testing.T) {
6666 blockExec := sm .NewBlockExecutor (stateStore , log .TestingLogger (), proxyApp .Consensus (),
6767 mp , sm.EmptyEvidencePool {}, blockStore )
6868
69- block := makeBlock (state , 1 , new (types.Commit ))
69+ block , err := makeBlock (state , 1 , new (types.Commit ))
70+ require .NoError (t , err )
7071 bps , err := block .MakePartSet (testPartSize )
7172 require .NoError (t , err )
7273 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 , 2 )
227230 require .NoError (t , err , tc .desc )
@@ -347,7 +350,8 @@ func TestFinalizeBlockMisbehavior(t *testing.T) {
347350 blockExec := sm .NewBlockExecutor (stateStore , log .TestingLogger (), proxyApp .Consensus (),
348351 mp , evpool , blockStore )
349352
350- block := makeBlock (state , 1 , new (types.Commit ))
353+ block , err := makeBlock (state , 1 , new (types.Commit ))
354+ require .NoError (t , err )
351355 block .Evidence = types.EvidenceData {Evidence : ev }
352356 block .Header .EvidenceHash = block .Evidence .Hash ()
353357 bps , err := block .MakePartSet (testPartSize )
@@ -394,7 +398,8 @@ func TestProcessProposal(t *testing.T) {
394398 blockStore ,
395399 )
396400
397- block0 := makeBlock (state , height - 1 , new (types.Commit ))
401+ block0 , err := makeBlock (state , height - 1 , new (types.Commit ))
402+ require .NoError (t , err )
398403 lastCommitSig := []types.CommitSig {}
399404 partSet , err := block0 .MakePartSet (types .BlockPartSizeBytes )
400405 require .NoError (t , err )
@@ -417,10 +422,11 @@ func TestProcessProposal(t *testing.T) {
417422 lastCommitSig = append (lastCommitSig , vote .CommitSig ())
418423 }
419424
420- block1 := makeBlock (state , height , & types.Commit {
425+ block1 , err := makeBlock (state , height , & types.Commit {
421426 Height : height - 1 ,
422427 Signatures : lastCommitSig ,
423428 })
429+ require .NoError (t , err )
424430
425431 block1 .Txs = txs
426432
@@ -615,7 +621,8 @@ func TestFinalizeBlockValidatorUpdates(t *testing.T) {
615621 )
616622 require .NoError (t , err )
617623
618- block := makeBlock (state , 1 , new (types.Commit ))
624+ block , err := makeBlock (state , 1 , new (types.Commit ))
625+ require .NoError (t , err )
619626 bps , err := block .MakePartSet (testPartSize )
620627 require .NoError (t , err )
621628 blockID := types.BlockID {Hash : block .Hash (), PartSetHeader : bps .Header ()}
@@ -675,7 +682,8 @@ func TestFinalizeBlockValidatorUpdatesResultingInEmptySet(t *testing.T) {
675682 blockStore ,
676683 )
677684
678- block := makeBlock (state , 1 , new (types.Commit ))
685+ block , err := makeBlock (state , 1 , new (types.Commit ))
686+ require .NoError (t , err )
679687 bps , err := block .MakePartSet (testPartSize )
680688 require .NoError (t , err )
681689 blockID := types.BlockID {Hash : block .Hash (), PartSetHeader : bps .Header ()}
@@ -1024,26 +1032,26 @@ func TestCreateProposalAbsentVoteExtensions(t *testing.T) {
10241032 }{
10251033 {
10261034 name : "missing extension data on first required height" ,
1027- height : 2 ,
1028- extensionEnableHeight : 1 ,
1035+ height : 3 ,
1036+ extensionEnableHeight : 2 ,
10291037 expectPanic : true ,
10301038 },
10311039 {
10321040 name : "missing extension during before required height" ,
1033- height : 2 ,
1034- extensionEnableHeight : 2 ,
1041+ height : 3 ,
1042+ extensionEnableHeight : 3 ,
10351043 expectPanic : false ,
10361044 },
10371045 {
10381046 name : "missing extension data and not required" ,
1039- height : 2 ,
1047+ height : 3 ,
10401048 extensionEnableHeight : 0 ,
10411049 expectPanic : false ,
10421050 },
10431051 {
10441052 name : "missing extension data and required in two heights" ,
1045- height : 2 ,
1046- extensionEnableHeight : 3 ,
1053+ height : 3 ,
1054+ extensionEnableHeight : 4 ,
10471055 expectPanic : false ,
10481056 },
10491057 } {
@@ -1087,7 +1095,8 @@ func TestCreateProposalAbsentVoteExtensions(t *testing.T) {
10871095 sm.EmptyEvidencePool {},
10881096 blockStore ,
10891097 )
1090- block := makeBlock (state , testCase .height , new (types.Commit ))
1098+ block , err := makeBlock (state , testCase .height , new (types.Commit ))
1099+ require .NoError (t , err )
10911100
10921101 bps , err := block .MakePartSet (testPartSize )
10931102 require .NoError (t , err )
@@ -1097,7 +1106,8 @@ func TestCreateProposalAbsentVoteExtensions(t *testing.T) {
10971106 stripSignatures (lastCommit )
10981107 if testCase .expectPanic {
10991108 require .Panics (t , func () {
1100- blockExec .CreateProposalBlock (ctx , testCase .height , state , lastCommit , pa ) //nolint:errcheck
1109+ _ , err := blockExec .CreateProposalBlock (ctx , testCase .height , state , lastCommit , pa )
1110+ require .NoError (t , err )
11011111 })
11021112 } else {
11031113 _ , err = blockExec .CreateProposalBlock (ctx , testCase .height , state , lastCommit , pa )
0 commit comments