From de002155bd4fd46e8d21adf5b79306973df68bef 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 982e3c9d1..1111b878f 100644 --- a/api/api_types.go +++ b/api/api_types.go @@ -449,6 +449,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 d10865664..73ff95134 100644 --- a/api/chain.go +++ b/api/chain.go @@ -901,6 +901,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, @@ -913,6 +917,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 {