abci: implement process proposal to spec (#9122)

This commit is contained in:
Callum Waters
2022-08-15 20:11:16 +02:00
committed by Sam Ricotta
parent d905bc013f
commit 6fe8d75498
35 changed files with 1971 additions and 333 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()
}