Skip to content

Commit

Permalink
fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Dec 15, 2020
1 parent 088b4ce commit dd9208a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions abci/client/socket_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ func resMatchesReq(req *types.Request, res *types.Response) (ok bool) {
_, ok = res.Value.(*types.Response_ListSnapshots)
case *types.Request_OfferSnapshot:
_, ok = res.Value.(*types.Response_OfferSnapshot)
case *types.Request_PreprocessTxs:
_, ok = res.Value.(*types.Response_PreprocessTxs)
}
return ok
}
Expand Down
3 changes: 3 additions & 0 deletions abci/server/socket_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types
case *types.Request_ApplySnapshotChunk:
res := s.app.ApplySnapshotChunk(*r.ApplySnapshotChunk)
responses <- types.ToResponseApplySnapshotChunk(res)
case *types.Request_PreprocessTxs:
res := s.app.PreprocessTxs(*r.PreprocessTxs)
responses <- types.ToResponsePreprocessTx(res)
default:
responses <- types.ToResponseException("Unknown request")
}
Expand Down
1 change: 1 addition & 0 deletions abci/types/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
// to be driven by a blockchain-based replication engine via the ABCI.
// All methods take a RequestXxx argument and return a ResponseXxx argument,
// except CheckTx/DeliverTx, which take `tx []byte`, and `Commit`, which takes nothing.
// nolint:lll // ignore for interface
type Application interface {
// Info/Query Connection
Info(RequestInfo) ResponseInfo // Return application info
Expand Down
13 changes: 6 additions & 7 deletions state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,16 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
// https://github.com/lazyledger/lazyledger-specs/blob/53e5f350838f1e0785ad670704bf91dac2f4f5a3/specs/block_proposer.md#deciding-on-a-block-size
// Here, we instead assume a fixed (max) square size instead.
// 2. feed them into MakeBlock below:

processedBlockTxs, err := blockExec.proxyApp.PreprocessTxsSync(abci.RequestPreprocessTxs{Txs: bzs})
if err != nil {
// The App MUST ensure that only valid (and hence 'processable')
// Tx enter the mempool. Hence, at this point, we can't have any non-processable
// transaction causing an error. Also, the App can simply skip any Tx that could cause any
// The App MUST ensure that only valid (and hence 'processable')
// Tx enter the mempool. Hence, at this point, we can't have any non-processable
// transaction causing an error. Also, the App can simply skip any Tx that could cause any
// kind of trouble.
// Either way, we can not recover in a meaningful way, unless we skip proposing
// this block, repair what caused the error and try again.
// Either way, we can not recover in a meaningful way, unless we skip proposing
// this block, repair what caused the error and try again.
// Hence we panic on purpose for now.
panic(err)
panic(err)
}

ppt := processedBlockTxs.GetTxs()
Expand Down

0 comments on commit dd9208a

Please sign in to comment.