Skip to content

Commit

Permalink
Fix milestone no-ack parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
avalkov committed Jan 3, 2025
1 parent 14edef7 commit 7fbf825
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
6 changes: 3 additions & 3 deletions consensus/bor/heimdall/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const (
fetchMilestone = "/milestone/latest"
fetchMilestoneCount = "/milestone/count"

fetchLastNoAckMilestone = "/milestone/lastNoAck"
fetchLastNoAckMilestone = "/milestone/last-no-ack"
fetchNoAckMilestone = "/milestone/noAck/%s"
fetchMilestoneID = "/milestone/ID/%s"

Expand Down Expand Up @@ -244,7 +244,7 @@ func (h *HeimdallClient) FetchLastNoAckMilestone(ctx context.Context) (string, e
return "", err
}

return response.Result.Result, nil
return response.Result, nil
}

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

if !response.Result.Result {
if !response.Result {
return fmt.Errorf("%w: milestoneID %q", ErrNotInRejectedList, milestoneID)
}

Expand Down
14 changes: 2 additions & 12 deletions consensus/bor/heimdall/milestone/milestone.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,12 @@ type MilestoneCountResponse struct {
Result MilestoneCount `json:"result"`
}

type MilestoneLastNoAck struct {
Result string `json:"result"`
}

type MilestoneLastNoAckResponse struct {
Height string `json:"height"`
Result MilestoneLastNoAck `json:"result"`
}

type MilestoneNoAck struct {
Result bool `json:"result"`
Result string `json:"result"`
}

type MilestoneNoAckResponse struct {
Height string `json:"height"`
Result MilestoneNoAck `json:"result"`
Result bool `json:"result"`
}

type MilestoneID struct {
Expand Down

0 comments on commit 7fbf825

Please sign in to comment.