Fix cap initialization by writing to uncached context (#6136)

This commit is contained in:
Aditya 2020-05-05 00:22:35 +05:30 committed by GitHub
parent 9ec46de285
commit 687d4246e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -31,3 +31,7 @@ func (app *BaseApp) NewContext(isCheckTx bool, header abci.Header) sdk.Context {
return sdk.NewContext(app.deliverState.ms, header, false, app.logger)
}
func (app *BaseApp) NewUncachedContext(isCheckTx bool, header abci.Header) sdk.Context {
return sdk.NewContext(app.cms, header, isCheckTx, app.logger)
}

View File

@ -345,7 +345,7 @@ func NewSimApp(
// sub-keepers.
// This must be done during creation of baseapp rather than in InitChain so
// that in-memory capabilities get regenerated on app restart
ctx := app.BaseApp.NewContext(true, abci.Header{})
ctx := app.BaseApp.NewUncachedContext(true, abci.Header{})
app.CapabilityKeeper.InitializeAndSeal(ctx)
app.ScopedIBCKeeper = scopedIBCKeeper