44import static org .junit .Assert .assertThrows ;
55import static org .junit .Assert .assertTrue ;
66import static org .junit .Assert .fail ;
7+ import static org .tron .core .config .Parameter .ChainConstant .DELEGATE_PERIOD ;
78import static org .tron .core .config .Parameter .ChainConstant .TRX_PRECISION ;
89import static org .tron .protos .contract .Common .ResourceCode .BANDWIDTH ;
910import static org .tron .protos .contract .Common .ResourceCode .ENERGY ;
@@ -435,7 +436,7 @@ public void testLockedDelegateResourceForBandwidth() {
435436
436437 @ Test
437438 public void testMaxDelegateLockPeriodForBandwidthWrongLockPeriod1 () {
438- dbManager .getDynamicPropertiesStore ().saveMaxDelegateLockPeriod (1 );
439+ dbManager .getDynamicPropertiesStore ().saveMaxDelegateLockPeriod (86401 );
439440 freezeBandwidthForOwner ();
440441 long delegateBalance = 1_000_000_000L ;
441442 DelegateResourceActuator actuator = new DelegateResourceActuator ();
@@ -444,7 +445,7 @@ public void testMaxDelegateLockPeriodForBandwidthWrongLockPeriod1() {
444445 delegateBalance , 370 * 24 * 3600 ));
445446 assertThrows ("The lock period of delegate resources cannot exceed 1 year!" ,
446447 ContractValidateException .class , actuator ::validate );
447- dbManager .getDynamicPropertiesStore ().saveMaxDelegateLockPeriod (0 );
448+ dbManager .getDynamicPropertiesStore ().saveMaxDelegateLockPeriod (DELEGATE_PERIOD / 3000 );
448449 }
449450
450451 @ Test
@@ -473,7 +474,7 @@ public void testMaxDelegateLockPeriodForBandwidthWrongLockPeriod2() {
473474 assertThrows ("The lock period for bandwidth this time cannot be less than the remaining"
474475 + " time[60000s] of the last lock period for bandwidth!" ,
475476 ContractValidateException .class , actuator1 ::validate );
476- dbManager .getDynamicPropertiesStore ().saveMaxDelegateLockPeriod (0 );
477+ dbManager .getDynamicPropertiesStore ().saveMaxDelegateLockPeriod (DELEGATE_PERIOD / 3000 );
477478 }
478479
479480 @ Test
0 commit comments