Skip to content

Commit

Permalink
Fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
p-offtermatt committed Aug 16, 2023
1 parent 73bdb02 commit aa1a91e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cometmock/abci_client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,11 @@ func (a *AbciClient) SendBeginBlock(block *types.Block) (*abcitypes.ResponseBegi
}

// build the BeginBlock request. evidence from block is taken to build misbehavior list
beginBlockRequest := a.CreateBeginBlockRequest(&block.Header, block.LastCommit, block.Evidence.Evidence.ToABCI())
byzVals := make([]abcitypes.Evidence, 0)
for _, evidence := range block.Evidence.Evidence {
byzVals = append(byzVals, evidence.ABCI()...)
}
beginBlockRequest := a.CreateBeginBlockRequest(&block.Header, block.LastCommit, byzVals)

// send BeginBlock to all clients and collect the responses
f := func(client AbciCounterpartyClient) (interface{}, error) {
Expand All @@ -308,7 +312,7 @@ func (a *AbciClient) SendBeginBlock(block *types.Block) (*abcitypes.ResponseBegi
return responses[0].(*abcitypes.ResponseBeginBlock), nil
}

func (a *AbciClient) CreateBeginBlockRequest(header *types.Header, lastCommit *types.Commit, misbehavior []abcitypes.Misbehavior) *abcitypes.RequestBeginBlock {
func (a *AbciClient) CreateBeginBlockRequest(header *types.Header, lastCommit *types.Commit, misbehavior []abcitypes.Evidence) *abcitypes.RequestBeginBlock {
commitSigs := lastCommit.Signatures

// if this is the first block, LastCommitInfo.Votes will be empty, see https://github.com/cometbft/cometbft/blob/release/v0.34.24/state/execution.go#L342
Expand Down Expand Up @@ -708,7 +712,7 @@ func (a *AbciClient) RunBlockWithTimeAndProposer(
evidences = append(evidences, &evidence)
}

block := a.CurState.MakeBlock(a.CurState.LastBlockHeight+1, txs, a.LastCommit, evidences, proposerAddress)
block, _ := a.CurState.MakeBlock(a.CurState.LastBlockHeight+1, txs, a.LastCommit, evidences, proposerAddress)
// override the block time, since we do not actually get votes from peers to median the time out of
block.Time = blockTime
blockId, err := utils.GetBlockIdFromBlock(block)
Expand Down

0 comments on commit aa1a91e

Please sign in to comment.