@@ -201,7 +201,7 @@ describe("ForkTest: Consolidation of Staking Strategies", function () {
201201 "0x67d077e55a1f4af124a8df1e1ac720d1e1e557a5305d774c5ebf98be3479cf8d"
202202 ) ;
203203
204- await compoundingStakingStrategy . connect ( registratorSigner ) . snapBalances ( ) ;
204+ await consolidationController . connect ( registratorSigner ) . snapBalances ( ) ;
205205
206206 await consolidationController
207207 . connect ( registratorSigner )
@@ -606,9 +606,17 @@ describe("ForkTest: Consolidation of Staking Strategies", function () {
606606
607607 await expect ( tx ) . to . be . revertedWith ( "No consolidation in progress" ) ;
608608 } ) ;
609+ it ( "Should call snapBalance on the Consolidation Controller by anyone when no consolidation in progress" , async ( ) => {
610+ const { josh } = fixture ;
611+ await advanceTime ( 12 * 40 ) ;
612+
613+ const tx = await consolidationController . connect ( josh ) . snapBalances ( ) ;
614+
615+ await expect ( tx ) . to . emit ( compoundingStakingStrategy , "BalancesSnapped" ) ;
616+ } ) ;
609617 it ( "Fail to directly call verifyBalance on the Compounding Staking Strategy" , async ( ) => {
610618 await advanceTime ( 12 * 40 ) ;
611- await compoundingStakingStrategy . snapBalances ( ) ;
619+ await consolidationController . snapBalances ( ) ;
612620
613621 const tx = compoundingStakingStrategy
614622 . connect ( registratorSigner )
@@ -795,17 +803,26 @@ describe("ForkTest: Consolidation of Staking Strategies", function () {
795803 await expect ( tx ) . to . emit ( compoundingStakingStrategy , "BalancesVerified" ) ;
796804 } ) ;
797805 // Balance proofs after the deposit to validator 13498458 has been verified.
798- it ( "Should call snapBalance on the Compounding Staking Strategy" , async ( ) => {
799- const { josh } = fixture ;
806+ it ( "Should call snapBalance on the Consolidation Controller by the Registrator after the consolidation has started" , async ( ) => {
800807 await advanceTime ( 12 * 40 ) ;
801808
802- const tx = await compoundingStakingStrategy . connect ( josh ) . snapBalances ( ) ;
809+ const tx = await consolidationController
810+ . connect ( registratorSigner )
811+ . snapBalances ( ) ;
803812
804813 await expect ( tx ) . to . emit ( compoundingStakingStrategy , "BalancesSnapped" ) ;
805814 } ) ;
806- it ( "Fail to verifyBalance of a snapshot after the consolidation was started" , async ( ) => {
815+ it ( "Fail snapBalance on the new compounding staking strategy when called by non-registrator after the consolidation has started" , async ( ) => {
816+ const { josh } = fixture ;
817+ await advanceTime ( 12 * 40 ) ;
818+
819+ const tx = compoundingStakingStrategy . connect ( josh ) . snapBalances ( ) ;
820+
821+ await expect ( tx ) . to . be . revertedWith ( "Not Registrator" ) ;
822+ } ) ;
823+ it ( "Fail to verifyBalance of a snapshot after the consolidation has started" , async ( ) => {
807824 await advanceTime ( 12 * 40 ) ;
808- await compoundingStakingStrategy . snapBalances ( ) ;
825+ await consolidationController . connect ( registratorSigner ) . snapBalances ( ) ;
809826
810827 const tx = consolidationController
811828 . connect ( registratorSigner )
@@ -1040,7 +1057,7 @@ describe("ForkTest: Consolidation of Staking Strategies", function () {
10401057 beaconBlockRoot
10411058 ) ;
10421059
1043- await compoundingStakingStrategy . connect ( fixture . josh ) . snapBalances ( ) ;
1060+ await consolidationController . connect ( registratorSigner ) . snapBalances ( ) ;
10441061 } ) ;
10451062
10461063 it ( "Should confirm consolidation" , async ( ) => {
0 commit comments