Skip to content

Commit

Permalink
fix TestHandShakeReplayAll
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-forbes committed May 1, 2021
1 parent a8517dd commit 1b61ae9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
7 changes: 0 additions & 7 deletions consensus/replay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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(
Expand Down
10 changes: 1 addition & 9 deletions store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1b61ae9

Please sign in to comment.