follow #7961 and complete process proposal to spec

This commit is contained in:
Callum Waters
2022-07-28 15:17:13 +02:00
parent d9d6a2f513
commit 227db0267b
18 changed files with 747 additions and 440 deletions

View File

@@ -262,6 +262,18 @@ func (app *Application) PrepareProposal(
return abci.ResponsePrepareProposal{BlockData: req.BlockData}
}
// 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()
}