Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
envestcc committed Jan 22, 2024
1 parent fe68fac commit 3b16390
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions action/protocol/staking/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,6 @@ func (p *Protocol) isActiveCandidate(ctx context.Context, csr CandidateStateRead
if address.Equal(vb.Owner, cand.Owner) {
return true, nil

Check warning on line 495 in action/protocol/staking/protocol.go

View check run for this annotation

Codecov / codecov/patch

action/protocol/staking/protocol.go#L494-L495

Added lines #L494 - L495 were not covered by tests
}
// bucket is not endorsed to the candidate
if !address.Equal(vb.Candidate, cand.Owner) {
return false, nil
}
esr := NewEndorsementStateReader(csr.SR())
endorse, err := esr.Get(cand.SelfStakeBucketIdx)
switch {
Expand All @@ -513,6 +509,7 @@ func (p *Protocol) isActiveCandidate(ctx context.Context, csr CandidateStateRead
return false, err
default:

Check warning on line 510 in action/protocol/staking/protocol.go

View check run for this annotation

Codecov / codecov/patch

action/protocol/staking/protocol.go#L510

Added line #L510 was not covered by tests
// endorsement does not exist
return false, errors.New("endorsement does not exist")

Check warning on line 512 in action/protocol/staking/protocol.go

View check run for this annotation

Codecov / codecov/patch

action/protocol/staking/protocol.go#L512

Added line #L512 was not covered by tests
}
return true, nil

Check warning on line 514 in action/protocol/staking/protocol.go

View check run for this annotation

Codecov / codecov/patch

action/protocol/staking/protocol.go#L514

Added line #L514 was not covered by tests
}
Expand Down

0 comments on commit 3b16390

Please sign in to comment.