@@ -166,15 +166,15 @@ func showAction(cCtx *cli.Context, p utils.Prompter) error {
166
166
dergisteredOpsets := make (DeregsiteredOperatorSets , 0 )
167
167
for strategy , allocations := range allAllocations {
168
168
logger .Debugf ("Strategy: %s, Allocations: %v" , strategy , allocations )
169
- strategyShares := operatorDelegatedSharesMap [strategy ]
169
+ totalStrategyShares := operatorDelegatedSharesMap [strategy ]
170
170
totalMagnitude := totalMagnitudeMap [strategy ]
171
171
for _ , alloc := range allocations {
172
172
173
173
// Check if the operator set is not registered and add it to the unregistered list
174
174
// Then skip the rest of the loop
175
175
if _ , ok := registeredOperatorSetsMap [getUniqueKey (alloc .AvsAddress , alloc .OperatorSetId )]; ! ok {
176
176
currentShares , currentSharesPercentage := getSharesFromMagnitude (
177
- strategyShares ,
177
+ totalStrategyShares ,
178
178
alloc .CurrentMagnitude .Uint64 (),
179
179
totalMagnitude ,
180
180
)
@@ -199,16 +199,20 @@ func showAction(cCtx *cli.Context, p utils.Prompter) error {
199
199
continue
200
200
}
201
201
202
+ // If the total shares in that strategy are zero, skip the operator set
203
+ if totalStrategyShares == nil || totalStrategyShares .Cmp (big .NewInt (0 )) == 0 {
204
+ continue
205
+ }
202
206
currentShares := slashableSharesMap [gethcommon .HexToAddress (strategy )][getUniqueKey (alloc .AvsAddress , alloc .OperatorSetId )]
203
- currentSharesPercentage := getSharePercentage (currentShares , strategyShares )
207
+ currentSharesPercentage := getSharePercentage (currentShares , totalStrategyShares )
204
208
205
209
newMagnitudeBigInt := big .NewInt (0 )
206
210
if alloc .PendingDiff .Cmp (big .NewInt (0 )) != 0 {
207
211
newMagnitudeBigInt = big .NewInt (0 ).Add (alloc .CurrentMagnitude , alloc .PendingDiff )
208
212
}
209
213
210
214
newShares , newSharesPercentage := getSharesFromMagnitude (
211
- strategyShares ,
215
+ totalStrategyShares ,
212
216
newMagnitudeBigInt .Uint64 (),
213
217
totalMagnitude ,
214
218
)
0 commit comments