Skip to content

Commit 6ea6091

Browse files
author
nidhi-singh02
committed
return correct response - e2e exisiting test fix
Signed-off-by: nidhi-singh02 <[email protected]>
1 parent 221db79 commit 6ea6091

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

node-api/handlers/node/sync.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var (
3333
)
3434

3535
// Syncing returns the syncing status of the node.
36-
func (h *Handler) Syncing(handlers.Context) (any, error) {
36+
func (h *Handler) Syncing(_ handlers.Context) (any, error) {
3737
node := h.backend.GetNode()
3838
if node == nil {
3939
return nil, errNilNode
@@ -62,5 +62,6 @@ func (h *Handler) Syncing(handlers.Context) (any, error) {
6262
response.IsSyncing = true
6363
}
6464

65-
return nodetypes.NewResponse(&response), nil
65+
return response, nil
66+
6667
}

node-api/handlers/node/types/response.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,3 @@ type SyncingData struct {
2727
IsOptimistic bool `json:"is_optimistic"`
2828
ELOffline bool `json:"el_offline"`
2929
}
30-
31-
type GenericResponse struct {
32-
ExecutionOptimistic bool `json:"execution_optimistic"`
33-
Finalized bool `json:"finalized"`
34-
Data any `json:"data"`
35-
}
36-
37-
// NewResponse creates a new response with CometBFT's finality guarantees.
38-
func NewResponse(data any) GenericResponse {
39-
return GenericResponse{
40-
// All data is finalized in CometBFT since we only return data for slots up to head
41-
Finalized: true,
42-
// Never optimistic since we only return finalized data
43-
ExecutionOptimistic: false,
44-
Data: data,
45-
}
46-
}

0 commit comments

Comments
 (0)