From dda94198ec4ea2e4795125622ec13bdea69cce43 Mon Sep 17 00:00:00 2001 From: Gui Iribarren Date: Wed, 28 Aug 2024 18:13:07 +0200 Subject: [PATCH] api: hotfix /chain/blocks/{height} --- api/api_types.go | 2 ++ api/chain.go | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/api/api_types.go b/api/api_types.go index 0cafa76fa..816db750e 100644 --- a/api/api_types.go +++ b/api/api_types.go @@ -448,6 +448,8 @@ type Block struct { comettypes.Header `json:"header"` Hash types.HexBytes `json:"hash" ` TxCount int64 `json:"txCount"` + // Data is not used anymore but kept here for a hotfix + Data comettypes.Data `json:"data"` } // BlockList is used to return a paginated list to the client diff --git a/api/chain.go b/api/chain.go index 6901d2417..cfc942a6e 100644 --- a/api/chain.go +++ b/api/chain.go @@ -897,6 +897,10 @@ func (a *API) chainBlockByHeightHandler(_ *apirest.APIdata, ctx *httprouter.HTTP if err != nil { return ErrIndexerQueryFailed.WithErr(err) } + dummyTxs := comettypes.Txs{} + for i := int64(0); i < txcount; i++ { + dummyTxs = append(dummyTxs, comettypes.Tx{}) + } block := &Block{ Header: comettypes.Header{ ChainID: idxblock.ChainID, @@ -909,6 +913,9 @@ func (a *API) chainBlockByHeightHandler(_ *apirest.APIdata, ctx *httprouter.HTTP }, Hash: idxblock.Hash, TxCount: txcount, + Data: comettypes.Data{ + Txs: dummyTxs, + }, } data, err := json.Marshal(block) if err != nil {