Skip to content

Commit

Permalink
chore(dot/parachain/backing): rename GetBackedCandidatesMessage to Ge…
Browse files Browse the repository at this point in the history
…tBackableCandidatesMessage (#4063)
  • Loading branch information
axaysagathiya committed Jun 27, 2024
1 parent c03248d commit 62fe5fb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dot/parachain/backing/candidate_backing.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ func (v validator) sign(keystore keystore.Keystore, payload parachaintypes.State
}, nil
}

// GetBackedCandidatesMessage is a message received from overseer that requests a set of backable
// GetBackableCandidatesMessage is a message received from overseer that requests a set of backable
// candidates that could be backed in a child of the given relay-parent.
type GetBackedCandidatesMessage struct {
type GetBackableCandidatesMessage struct {
Candidates []*CandidateHashAndRelayParent
ResCh chan []*parachaintypes.BackedCandidate
}
Expand Down Expand Up @@ -249,8 +249,8 @@ func (*CandidateBacking) Name() parachaintypes.SubSystemName {
// processMessage processes incoming messages from overseer
func (cb *CandidateBacking) processMessage(msg any, chRelayParentAndCommand chan relayParentAndCommand) error {
switch msg := msg.(type) {
case GetBackedCandidatesMessage:
cb.handleGetBackedCandidatesMessage(msg)
case GetBackableCandidatesMessage:
cb.handleGetBackableCandidatesMessage(msg)
case CanSecondMessage:
err := cb.handleCanSecondMessage(msg)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import (
parachaintypes "github.com/ChainSafe/gossamer/dot/parachain/types"
)

func (cb *CandidateBacking) handleGetBackedCandidatesMessage(requestedCandidates GetBackedCandidatesMessage) {
// handleGetBackableCandidatesMessage send back the backable candidates via the response channel
func (cb *CandidateBacking) handleGetBackableCandidatesMessage(requestedCandidates GetBackableCandidatesMessage) {
var backedCandidates []*parachaintypes.BackedCandidate

for _, candidate := range requestedCandidates.Candidates {
Expand Down
4 changes: 2 additions & 2 deletions dot/parachain/backing/get_backed_candidates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func TestHandleGetBackedCandidatesMessage(t *testing.T) {
resCh := make(chan []*parachaintypes.BackedCandidate)
defer close(resCh)

requestedCandidates := GetBackedCandidatesMessage{
requestedCandidates := GetBackableCandidatesMessage{
Candidates: []*CandidateHashAndRelayParent{
{
CandidateHash: dummyCandidateHash(t),
Expand All @@ -118,7 +118,7 @@ func TestHandleGetBackedCandidatesMessage(t *testing.T) {
perRelayParent: tc.perRelayParent(),
}

cb.handleGetBackedCandidatesMessage(requestedCandidates)
cb.handleGetBackableCandidatesMessage(requestedCandidates)
})
}

Expand Down
2 changes: 1 addition & 1 deletion dot/parachain/overseer/overseer.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (o *OverseerSystem) processMessages() {
var subsystem parachaintypes.Subsystem

switch msg := msg.(type) {
case backing.GetBackedCandidatesMessage, backing.CanSecondMessage, backing.SecondMessage, backing.StatementMessage:
case backing.GetBackableCandidatesMessage, backing.CanSecondMessage, backing.SecondMessage, backing.StatementMessage:
subsystem = o.nameToSubsystem[parachaintypes.CandidateBacking]

case collatorprotocolmessages.CollateOn, collatorprotocolmessages.DistributeCollation,
Expand Down

0 comments on commit 62fe5fb

Please sign in to comment.