@@ -866,15 +866,15 @@ describe('UFragmentsPolicy:Rebase', async function () {
866
866
} )
867
867
868
868
describe ( 'when the market oracle returns invalid data' , function ( ) {
869
- it ( 'should fail' , async function ( ) {
869
+ it ( 'should NOT fail' , async function ( ) {
870
870
await mockExternalData (
871
871
INITIAL_RATE_30P_MORE ,
872
872
INITIAL_TARGET_RATE ,
873
873
1000 ,
874
874
false ,
875
875
)
876
876
await increaseTime ( 60 )
877
- await expect ( uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ) . to . be
877
+ await expect ( uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ) . to . not . be
878
878
. reverted
879
879
} )
880
880
} )
@@ -908,7 +908,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
908
908
} )
909
909
910
910
describe ( 'when the cpi oracle returns invalid data' , function ( ) {
911
- it ( 'should fail' , async function ( ) {
911
+ it ( 'should NOT fail' , async function ( ) {
912
912
await mockExternalData (
913
913
INITIAL_RATE_30P_MORE ,
914
914
INITIAL_TARGET_RATE ,
@@ -917,7 +917,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
917
917
false ,
918
918
)
919
919
await increaseTime ( 60 )
920
- await expect ( uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ) . to . be
920
+ await expect ( uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ) . to . not . be
921
921
. reverted
922
922
} )
923
923
} )
@@ -1204,6 +1204,50 @@ describe('UFragmentsPolicy:Rebase', async function () {
1204
1204
) . to . eq ( 0 )
1205
1205
} )
1206
1206
} )
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
+ } )
1207
1251
} )
1208
1252
1209
1253
describe ( 'UFragmentsPolicy:Rebase' , async function ( ) {
0 commit comments