@@ -77,8 +77,7 @@ func (sh *Slasher) EmptyBlacklist() *vote.Blacklist {
77
77
78
78
// GetCandidates returns candidate list
79
79
func (sh * Slasher ) GetCandidates (ctx context.Context , sr protocol.StateReader , readFromNext bool ) (state.CandidateList , error ) {
80
- bcCtx := protocol .MustGetBlockchainCtx (ctx )
81
- rp := rolldpos .MustGetProtocol (bcCtx .Registry )
80
+ rp := rolldpos .MustGetProtocol (protocol .MustGetRegistry (ctx ))
82
81
targetHeight , err := sr .Height ()
83
82
if err != nil {
84
83
return nil , err
@@ -120,8 +119,7 @@ func (sh *Slasher) GetBlockProducers(ctx context.Context, sr protocol.StateReade
120
119
121
120
// GetActiveBlockProducers returns active BP list
122
121
func (sh * Slasher ) GetActiveBlockProducers (ctx context.Context , sr protocol.StateReader , readFromNext bool ) (state.CandidateList , error ) {
123
- bcCtx := protocol .MustGetBlockchainCtx (ctx )
124
- rp := rolldpos .MustGetProtocol (bcCtx .Registry )
122
+ rp := rolldpos .MustGetProtocol (protocol .MustGetRegistry (ctx ))
125
123
targetHeight , err := sr .Height ()
126
124
if err != nil {
127
125
return nil , err
@@ -177,8 +175,7 @@ func (sh *Slasher) GetABPFromIndexer(ctx context.Context, epochStartHeight uint6
177
175
178
176
// GetKickoutList returns the kick-out list at given epoch
179
177
func (sh * Slasher ) GetKickoutList (ctx context.Context , sr protocol.StateReader , readFromNext bool ) (* vote.Blacklist , error ) {
180
- bcCtx := protocol .MustGetBlockchainCtx (ctx )
181
- rp := rolldpos .MustGetProtocol (bcCtx .Registry )
178
+ rp := rolldpos .MustGetProtocol (protocol .MustGetRegistry (ctx ))
182
179
targetHeight , err := sr .Height ()
183
180
if err != nil {
184
181
return nil , err
@@ -209,8 +206,7 @@ func (sh *Slasher) CalculateKickoutList(
209
206
sm protocol.StateManager ,
210
207
epochNum uint64 ,
211
208
) (* vote.Blacklist , error ) {
212
- bcCtx := protocol .MustGetBlockchainCtx (ctx )
213
- rp := rolldpos .MustGetProtocol (bcCtx .Registry )
209
+ rp := rolldpos .MustGetProtocol (protocol .MustGetRegistry (ctx ))
214
210
easterEpochNum := rp .GetEpochNum (sh .hu .EasterBlockHeight ())
215
211
216
212
nextBlacklist := & vote.Blacklist {
0 commit comments