Show height on legacy REST endpoints (#7997)

* Fix showing height in rest endpoints

* Fix query height

* Manually inject req.Height

* Small tweaks

* Use withHeight

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Amaury
2020-11-24 10:28:12 +00:00
committed by GitHub
co-authored by Aleksandr Bezobchuk mergify[bot]
parent 251a27d104
commit 74435137e9
4 changed files with 41 additions and 39 deletions
+1 -2
View File
@@ -11,7 +11,6 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec/legacy"
"github.com/cosmos/cosmos-sdk/types/rest"
)
@@ -68,7 +67,7 @@ func getBlock(clientCtx client.Context, height *int64) ([]byte, error) {
return nil, err
}
return legacy.Cdc.MarshalJSON(res)
return clientCtx.LegacyAmino.MarshalJSON(res)
}
// get the current blockchain height