feat: Create ABCI++ Verfication Methods (#15298)
This commit is contained in:
+22
-12
@@ -225,21 +225,31 @@ func NewSimApp(
|
||||
interfaceRegistry := encodingConfig.InterfaceRegistry
|
||||
txConfig := encodingConfig.TxConfig
|
||||
|
||||
// Below we could construct and set an application specific mempool and ABCI 1.0 Prepare and Process Proposal
|
||||
// handlers. These defaults are already set in the SDK's BaseApp, this shows an example of how to override
|
||||
// Below we could construct and set an application specific mempool and
|
||||
// ABCI 1.0 PrepareProposal and ProcessProposal handlers. These defaults are
|
||||
// already set in the SDK's BaseApp, this shows an example of how to override
|
||||
// them.
|
||||
//
|
||||
// nonceMempool := mempool.NewSenderNonceMempool()
|
||||
// mempoolOpt := baseapp.SetMempool(nonceMempool)
|
||||
// prepareOpt := func(app *baseapp.BaseApp) {
|
||||
// app.SetPrepareProposal(app.DefaultPrepareProposal())
|
||||
// }
|
||||
// processOpt := func(app *baseapp.BaseApp) {
|
||||
// app.SetProcessProposal(app.DefaultProcessProposal())
|
||||
// }
|
||||
// Example:
|
||||
//
|
||||
// Further down we'd set the options in the AppBuilder like below.
|
||||
// baseAppOptions = append(baseAppOptions, mempoolOpt, prepareOpt, processOpt)
|
||||
// bApp := baseapp.NewBaseApp(...)
|
||||
// nonceMempool := mempool.NewSenderNonceMempool()
|
||||
// abciPropHandler := NewDefaultProposalHandler(nonceMempool, bApp)
|
||||
//
|
||||
// bApp.SetMempool(nonceMempool)
|
||||
// bApp.SetPrepareProposal(abciPropHandler.PrepareProposalHandler())
|
||||
// bApp.SetProcessProposal(abciPropHandler.ProcessProposalHandler())
|
||||
//
|
||||
// Alternatively, you can construct BaseApp options, append those to
|
||||
// baseAppOptions and pass them to NewBaseApp.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// prepareOpt = func(app *baseapp.BaseApp) {
|
||||
// abciPropHandler := baseapp.NewDefaultProposalHandler(nonceMempool, app)
|
||||
// app.SetPrepareProposal(abciPropHandler.PrepareProposalHandler())
|
||||
// }
|
||||
// baseAppOptions = append(baseAppOptions, prepareOpt)
|
||||
|
||||
bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseAppOptions...)
|
||||
bApp.SetCommitMultiStoreTracer(traceStore)
|
||||
|
||||
+26
-15
@@ -167,21 +167,6 @@ func NewSimApp(
|
||||
var (
|
||||
app = &SimApp{}
|
||||
appBuilder *runtime.AppBuilder
|
||||
// Below we could construct and set an application specific mempool and ABCI 1.0 Prepare and Process Proposal
|
||||
// handlers. These defaults are already set in the SDK's BaseApp, this shows an example of how to override
|
||||
// them.
|
||||
//
|
||||
// nonceMempool = mempool.NewSenderNonceMempool()
|
||||
// mempoolOpt = baseapp.SetMempool(nonceMempool)
|
||||
// prepareOpt = func(app *baseapp.BaseApp) {
|
||||
// app.SetPrepareProposal(app.DefaultPrepareProposal())
|
||||
// }
|
||||
// processOpt = func(app *baseapp.BaseApp) {
|
||||
// app.SetProcessProposal(app.DefaultProcessProposal())
|
||||
// }
|
||||
//
|
||||
// Further down we'd set the options in the AppBuilder like below.
|
||||
// baseAppOptions = append(baseAppOptions, mempoolOpt, prepareOpt, processOpt)
|
||||
|
||||
// merge the AppConfig and other configuration in one config
|
||||
appConfig = depinject.Configs(
|
||||
@@ -244,6 +229,32 @@ func NewSimApp(
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Below we could construct and set an application specific mempool and
|
||||
// ABCI 1.0 PrepareProposal and ProcessProposal handlers. These defaults are
|
||||
// already set in the SDK's BaseApp, this shows an example of how to override
|
||||
// them.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// app.App = appBuilder.Build(...)
|
||||
// nonceMempool := mempool.NewSenderNonceMempool()
|
||||
// abciPropHandler := NewDefaultProposalHandler(nonceMempool, app.App.BaseApp)
|
||||
//
|
||||
// app.App.BaseApp.SetMempool(nonceMempool)
|
||||
// app.App.BaseApp.SetPrepareProposal(abciPropHandler.PrepareProposalHandler())
|
||||
// app.App.BaseApp.SetProcessProposal(abciPropHandler.ProcessProposalHandler())
|
||||
//
|
||||
// Alternatively, you can construct BaseApp options, append those to
|
||||
// baseAppOptions and pass them to the appBuilder.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// prepareOpt = func(app *baseapp.BaseApp) {
|
||||
// abciPropHandler := baseapp.NewDefaultProposalHandler(nonceMempool, app)
|
||||
// app.SetPrepareProposal(abciPropHandler.PrepareProposalHandler())
|
||||
// }
|
||||
// baseAppOptions = append(baseAppOptions, prepareOpt)
|
||||
|
||||
app.App = appBuilder.Build(logger, db, traceStore, baseAppOptions...)
|
||||
|
||||
if err := app.App.BaseApp.SetStreamingService(appOpts, app.appCodec, app.kvStoreKeys()); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user