File tree 1 file changed +19
-1
lines changed
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -623,12 +623,30 @@ contract AllocationManager is
623
623
OperatorSet memory operatorSet
624
624
) external view returns (IStrategy[] memory ) {
625
625
address [] memory values = allocatedStrategies[operator][operatorSet.key ()].values ();
626
+
626
627
IStrategy[] memory strategies;
627
-
628
628
assembly {
629
629
strategies := values
630
630
}
631
631
632
+ /// Iterate over allocatedStrategies and keep only the strategies for which we have active allocations
633
+ IStrategy[] memory results = new IStrategy [](values.length );
634
+ uint resultIdx = 0 ;
635
+ for (uint i = 0 ; i < strategies.length ; i++ ) {
636
+ Allocation memory allocation = getAllocation (operator, operatorSet, strategies[i]);
637
+
638
+ /// Skip if there is NEITHER a current NOR a pending allocation
639
+ /// TODO - do we want to keep ONLY current allocations, and expose pending in a different
640
+ /// method? This also brings into question _updateAllocationInfo marking things allocated
641
+ /// when they are in fact pending?
642
+ if (allocation.currentMagnitude == 0 && allocation.pendingDiff == 0 ) {
643
+ continue ;
644
+ }
645
+
646
+ results[resultIdx] = strategies[i];
647
+ resultIdx++ ;
648
+ }
649
+
632
650
return strategies;
633
651
}
634
652
You can’t perform that action at this time.
0 commit comments