From 1b61ae96a693deea78fb32d0e05061fbf2ef4079 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Sat, 1 May 2021 18:32:59 -0500 Subject: [PATCH] fix TestHandShakeReplayAll --- consensus/replay_test.go | 7 ------- store/store.go | 10 +--------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/consensus/replay_test.go b/consensus/replay_test.go index 26f5656dee..b979dce705 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -571,12 +571,6 @@ func TestSimulateValidatorsChange(t *testing.T) { } sim.Chain = append(sim.Chain, b) commit := css[0].blockStore.LoadBlockCommit(int64(i)) - if commit != nil { - fmt.Println(i, commit.BlockID.DataAvailabilityHeader.IsZero(), b.LastCommit.BlockID.DataAvailabilityHeader.IsZero()) - } else { - fmt.Println(b.LastCommit.BlockID.DataAvailabilityHeader.IsZero()) - } - sim.Commits = append(sim.Commits, commit) } @@ -1017,7 +1011,6 @@ func makeBlocks(n int, state *sm.State, privVal types.PrivValidator) []*types.Bl func makeBlock(state sm.State, lastBlock *types.Block, lastBlockMeta *types.BlockMeta, privVal types.PrivValidator, height int64) (*types.Block, *types.PartSet) { - lastCommit := types.NewCommit(height-1, 0, types.BlockID{}, nil) if height > 1 { vote, _ := types.MakeVote( diff --git a/store/store.go b/store/store.go index 526cb6f2f5..0ca53bbfee 100644 --- a/store/store.go +++ b/store/store.go @@ -129,15 +129,7 @@ func (bs *BlockStore) LoadBlock(ctx context.Context, height int64) (*types.Block return nil, fmt.Errorf("failuring retrieve block data from ipfs: %w", err) } - var lastCommit *types.Commit - switch { - case height > bs.Height()-1: - lastCommit = bs.LoadSeenCommit(height - 1) - case height == 0: - lastCommit = nil - default: - lastCommit = bs.LoadBlockCommit(height - 1) - } + lastCommit := bs.LoadBlockCommit(height - 1) block := &types.Block{ Header: blockMeta.Header,