@@ -866,15 +866,15 @@ describe('UFragmentsPolicy:Rebase', async function () {
866866 } )
867867
868868 describe ( 'when the market oracle returns invalid data' , function ( ) {
869- it ( 'should fail' , async function ( ) {
869+ it ( 'should NOT fail' , async function ( ) {
870870 await mockExternalData (
871871 INITIAL_RATE_30P_MORE ,
872872 INITIAL_TARGET_RATE ,
873873 1000 ,
874874 false ,
875875 )
876876 await increaseTime ( 60 )
877- await expect ( uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ) . to . be
877+ await expect ( uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ) . to . not . be
878878 . reverted
879879 } )
880880 } )
@@ -908,7 +908,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
908908 } )
909909
910910 describe ( 'when the cpi oracle returns invalid data' , function ( ) {
911- it ( 'should fail' , async function ( ) {
911+ it ( 'should NOT fail' , async function ( ) {
912912 await mockExternalData (
913913 INITIAL_RATE_30P_MORE ,
914914 INITIAL_TARGET_RATE ,
@@ -917,7 +917,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
917917 false ,
918918 )
919919 await increaseTime ( 60 )
920- await expect ( uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ) . to . be
920+ await expect ( uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ) . to . not . be
921921 . reverted
922922 } )
923923 } )
@@ -1204,6 +1204,50 @@ describe('UFragmentsPolicy:Rebase', async function () {
12041204 ) . to . eq ( 0 )
12051205 } )
12061206 } )
1207+
1208+ describe ( 'rate is invalid' , function ( ) {
1209+ before ( async function ( ) {
1210+ await mockExternalData (
1211+ INITIAL_RATE_30P_MORE ,
1212+ INITIAL_TARGET_RATE ,
1213+ 1000 ,
1214+ false ,
1215+ )
1216+ await uFragmentsPolicy . connect ( deployer ) . setDeviationThreshold ( 0 )
1217+ await increaseTime ( 60 )
1218+ } )
1219+
1220+ it ( 'should emit Rebase with 0 requestedSupplyAdjustment' , async function ( ) {
1221+ expect (
1222+ (
1223+ await parseRebaseEvent (
1224+ uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ,
1225+ )
1226+ ) . requestedSupplyAdjustment ,
1227+ ) . to . eq ( 0 )
1228+ } )
1229+ } )
1230+
1231+ describe ( 'target rate is invalid' , function ( ) {
1232+ before ( async function ( ) {
1233+ await mockExternalData (
1234+ INITIAL_RATE ,
1235+ INITIAL_TARGET_RATE_25P_MORE ,
1236+ 1000 ,
1237+ true ,
1238+ false ,
1239+ )
1240+ await uFragmentsPolicy . connect ( deployer ) . setDeviationThreshold ( 0 )
1241+ await increaseTime ( 60 )
1242+ } )
1243+
1244+ it ( 'should emit Rebase with 0 requestedSupplyAdjustment' , async function ( ) {
1245+ expect (
1246+ ( await parseRebaseEvent ( uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ) )
1247+ . requestedSupplyAdjustment ,
1248+ ) . to . eq ( 0 )
1249+ } )
1250+ } )
12071251} )
12081252
12091253describe ( 'UFragmentsPolicy:Rebase' , async function ( ) {
0 commit comments