ABCI++: Update new protos to use enum instead of bool (#8158)

closes: #8039 

This pull request updates the new ABCI++ protos to use `enum`s in place of `bool`s. `enums` may be preferred over `bool` because an `enum` can be udpated to include new statuses in the future, whereas a `bool` cannot and is fixed as just `true` or `false` over the whole lifecycle of the API.
This commit is contained in:
William Banfield
2022-03-21 16:57:34 +00:00
committed by GitHub
parent c33be0a410
commit cc838a5a19
15 changed files with 599 additions and 461 deletions
+3 -3
View File
@@ -306,7 +306,7 @@ func (app *Application) ApplySnapshotChunk(req abci.RequestApplySnapshotChunk) a
func (app *Application) PrepareProposal(req abci.RequestPrepareProposal) abci.ResponsePrepareProposal {
// None of the transactions are modified by this application.
return abci.ResponsePrepareProposal{ModifiedTx: false}
return abci.ResponsePrepareProposal{ModifiedTxStatus: abci.ResponsePrepareProposal_UNMODIFIED}
}
// ProcessProposal implements part of the Application interface.
@@ -315,10 +315,10 @@ func (app *Application) ProcessProposal(req abci.RequestProcessProposal) abci.Re
for _, tx := range req.Txs {
_, _, err := parseTx(tx)
if err != nil {
return abci.ResponseProcessProposal{Accept: false}
return abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}
}
}
return abci.ResponseProcessProposal{Accept: true}
return abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT}
}
func (app *Application) Rollback() error {