abci: implement process proposal to spec (#9122)

This commit is contained in:
Callum Waters
2022-08-09 15:15:18 +02:00
committed by GitHub
parent b2409b3345
commit f861062ee2
39 changed files with 2004 additions and 351 deletions
+12
View File
@@ -275,6 +275,18 @@ func (app *Application) PrepareProposal(
return abci.ResponsePrepareProposal{TxRecords: trs}
}
// ProcessProposal implements part of the Application interface.
// It accepts any proposal that does not contain a malformed transaction.
func (app *Application) ProcessProposal(req abci.RequestProcessProposal) abci.ResponseProcessProposal {
for _, tx := range req.Txs {
_, _, err := parseTx(tx)
if err != nil {
return abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}
}
}
return abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT}
}
func (app *Application) Rollback() error {
return app.state.Rollback()
}