diff --git a/CHANGELOG.md b/CHANGELOG.md index 2244de1fadf7..ad94668c93c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -161,6 +161,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* [\#10827](https://github.com/cosmos/cosmos-sdk/pull/10827) Create query `Context` with requested block height * [\#10414](https://github.com/cosmos/cosmos-sdk/pull/10414) Use `sdk.GetConfig().GetFullBIP44Path()` instead `sdk.FullFundraiserPath` to generate key * (rosetta) [\#10340](https://github.com/cosmos/cosmos-sdk/pull/10340) Use `GenesisChunked(ctx)` instead `Genesis(ctx)` to get genesis block height * [#10180](https://github.com/cosmos/cosmos-sdk/issues/10180) Documentation: make references to Cosmos SDK consistent diff --git a/baseapp/abci.go b/baseapp/abci.go index 6f354ba51c73..6954bb7e017f 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -657,7 +657,7 @@ func (app *BaseApp) createQueryContext(height int64, prove bool) (sdk.Context, e // branch the commit-multistore for safety ctx := sdk.NewContext( cacheMS, app.checkState.ctx.BlockHeader(), true, app.logger, - ).WithMinGasPrices(app.minGasPrices) + ).WithMinGasPrices(app.minGasPrices).WithBlockHeight(height) return ctx, nil } diff --git a/client/query.go b/client/query.go index b10a0e348026..f81787147e91 100644 --- a/client/query.go +++ b/client/query.go @@ -131,8 +131,9 @@ func sdkErrorToGRPCError(resp abci.ResponseQuery) error { // or an error if the query fails. func (ctx Context) query(path string, key tmbytes.HexBytes) ([]byte, int64, error) { resp, err := ctx.queryABCI(abci.RequestQuery{ - Path: path, - Data: key, + Path: path, + Data: key, + Height: ctx.Height, }) if err != nil { return nil, 0, err