Skip to content

Commit 7fbf825

Browse files
committed
Fix milestone no-ack parsing
1 parent 14edef7 commit 7fbf825

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

consensus/bor/heimdall/client.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const (
8585
fetchMilestone = "/milestone/latest"
8686
fetchMilestoneCount = "/milestone/count"
8787

88-
fetchLastNoAckMilestone = "/milestone/lastNoAck"
88+
fetchLastNoAckMilestone = "/milestone/last-no-ack"
8989
fetchNoAckMilestone = "/milestone/noAck/%s"
9090
fetchMilestoneID = "/milestone/ID/%s"
9191

@@ -244,7 +244,7 @@ func (h *HeimdallClient) FetchLastNoAckMilestone(ctx context.Context) (string, e
244244
return "", err
245245
}
246246

247-
return response.Result.Result, nil
247+
return response.Result, nil
248248
}
249249

250250
// FetchNoAckMilestone fetches the last no-ack-milestone from heimdall
@@ -261,7 +261,7 @@ func (h *HeimdallClient) FetchNoAckMilestone(ctx context.Context, milestoneID st
261261
return err
262262
}
263263

264-
if !response.Result.Result {
264+
if !response.Result {
265265
return fmt.Errorf("%w: milestoneID %q", ErrNotInRejectedList, milestoneID)
266266
}
267267

consensus/bor/heimdall/milestone/milestone.go

+2-12
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,12 @@ type MilestoneCountResponse struct {
7676
Result MilestoneCount `json:"result"`
7777
}
7878

79-
type MilestoneLastNoAck struct {
80-
Result string `json:"result"`
81-
}
82-
8379
type MilestoneLastNoAckResponse struct {
84-
Height string `json:"height"`
85-
Result MilestoneLastNoAck `json:"result"`
86-
}
87-
88-
type MilestoneNoAck struct {
89-
Result bool `json:"result"`
80+
Result string `json:"result"`
9081
}
9182

9283
type MilestoneNoAckResponse struct {
93-
Height string `json:"height"`
94-
Result MilestoneNoAck `json:"result"`
84+
Result bool `json:"result"`
9585
}
9686

9787
type MilestoneID struct {

0 commit comments

Comments
 (0)