From 687d4246e5a3f368e556e24709b31bf8df93def9 Mon Sep 17 00:00:00 2001 From: Aditya Date: Tue, 5 May 2020 00:22:35 +0530 Subject: [PATCH] Fix cap initialization by writing to uncached context (#6136) --- baseapp/helpers.go | 4 ++++ simapp/app.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/baseapp/helpers.go b/baseapp/helpers.go index aa9c10d328..085d6b4ed6 100644 --- a/baseapp/helpers.go +++ b/baseapp/helpers.go @@ -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) +} diff --git a/simapp/app.go b/simapp/app.go index 0d44f006f1..c7b474b6d7 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -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