@@ -78,7 +78,6 @@ import {
78
78
deployTimeSeriesFeedAsync ,
79
79
deployTokensSpecifyingDecimals ,
80
80
deployWhiteListContract ,
81
- increaseChainTimeAsync ,
82
81
initializeManagerAsync ,
83
82
} from '@test/helpers' ;
84
83
import {
@@ -578,152 +577,6 @@ describe('AssetPairManagerV2Wrapper', () => {
578
577
} ) ;
579
578
} ) ;
580
579
581
- describe ( 'initialPropose' , async ( ) => {
582
- let subjectManagerAddress : Address ;
583
-
584
- beforeEach ( async ( ) => {
585
- subjectManagerAddress = assetPairManagerV2 . address ;
586
-
587
- // Elapse the rebalance interval
588
- await increaseChainTimeAsync ( web3 , ONE_DAY_IN_SECONDS ) ;
589
- } ) ;
590
-
591
- async function subject ( ) : Promise < string > {
592
- return await assetPairManagerV2Wrapper . initialPropose (
593
- subjectManagerAddress ,
594
- ) ;
595
- }
596
-
597
- test ( 'sets the recentInitialProposeTimestamp properly' , async ( ) => {
598
- const txnHash = await subject ( ) ;
599
- const { blockNumber } = await web3 . eth . getTransactionReceipt ( txnHash ) ;
600
- const { timestamp } = await web3 . eth . getBlock ( blockNumber ) ;
601
-
602
- const lastTimestamp = await assetPairManagerV2Wrapper . recentInitialProposeTimestamp (
603
- subjectManagerAddress ,
604
- ) ;
605
- expect ( lastTimestamp ) . to . bignumber . equal ( timestamp ) ;
606
- } ) ;
607
- } ) ;
608
-
609
- describe ( 'confirmPropose' , async ( ) => {
610
- let subjectManagerAddress : Address ;
611
-
612
- beforeEach ( async ( ) => {
613
- subjectManagerAddress = assetPairManagerV2 . address ;
614
-
615
- // Elapse the rebalance interval
616
- await increaseChainTimeAsync ( web3 , ONE_DAY_IN_SECONDS ) ;
617
- await assetPairManagerV2 . initialPropose . sendTransactionAsync ( ) ;
618
-
619
- // Issue currentSetToken
620
- await core . issue . sendTransactionAsync (
621
- initialBaseCollateral . address ,
622
- ether ( 9 ) ,
623
- { from : DEFAULT_ACCOUNT } ,
624
- ) ;
625
- await approveForTransferAsync ( [ initialBaseCollateral ] , transferProxy . address ) ;
626
-
627
- // Use issued currentSetToken to issue rebalancingSetToken
628
- await core . issue . sendTransactionAsync (
629
- rebalancingSetToken . address ,
630
- ether ( 7 ) ,
631
- { from : DEFAULT_ACCOUNT } ,
632
- ) ;
633
-
634
- // Elapse the signal confirmation period
635
- await increaseChainTimeAsync ( web3 , ONE_HOUR_IN_SECONDS . mul ( 7 ) ) ;
636
- } ) ;
637
-
638
- async function subject ( ) : Promise < string > {
639
- return await assetPairManagerV2Wrapper . confirmPropose (
640
- subjectManagerAddress ,
641
- ) ;
642
- }
643
-
644
- test ( 'sets the rebalancing Set into rebalance period' , async ( ) => {
645
- await subject ( ) ;
646
- const rebalanceStateEnum = new BigNumber ( 2 ) ;
647
- const rebalancingSetState = await rebalancingSetToken . rebalanceState . callAsync ( ) ;
648
-
649
- expect ( rebalancingSetState ) . to . bignumber . equal ( rebalanceStateEnum ) ;
650
- } ) ;
651
- } ) ;
652
-
653
- describe ( 'canInitialPropose' , async ( ) => {
654
- let subjectManagerAddress : Address ;
655
- let subjectTimeFastForward : BigNumber ;
656
-
657
- beforeEach ( async ( ) => {
658
- subjectManagerAddress = assetPairManagerV2 . address ;
659
- subjectTimeFastForward = ONE_DAY_IN_SECONDS ;
660
- } ) ;
661
-
662
- async function subject ( ) : Promise < boolean > {
663
- await increaseChainTimeAsync ( web3 , subjectTimeFastForward ) ;
664
- return await assetPairManagerV2Wrapper . canInitialPropose (
665
- subjectManagerAddress ,
666
- ) ;
667
- }
668
-
669
- test ( 'sets the recentInitialProposeTimestamp properly' , async ( ) => {
670
- const canInitialPropose = await subject ( ) ;
671
-
672
- expect ( canInitialPropose ) . to . be . true ;
673
- } ) ;
674
-
675
- describe ( 'when initialPropose not valid' , async ( ) => {
676
- beforeEach ( async ( ) => {
677
- subjectTimeFastForward = ZERO ;
678
- } ) ;
679
-
680
- test ( 'returns false' , async ( ) => {
681
- const canInitialPropose = await subject ( ) ;
682
-
683
- expect ( canInitialPropose ) . to . be . false ;
684
- } ) ;
685
- } ) ;
686
- } ) ;
687
-
688
- describe ( 'canConfirmPropose' , async ( ) => {
689
- let subjectManagerAddress : Address ;
690
- let subjectTimeFastForward : BigNumber ;
691
-
692
- beforeEach ( async ( ) => {
693
- subjectManagerAddress = assetPairManagerV2 . address ;
694
- subjectTimeFastForward = ONE_HOUR_IN_SECONDS . mul ( 7 ) ;
695
-
696
- // Elapse the rebalance interval
697
- await increaseChainTimeAsync ( web3 , ONE_DAY_IN_SECONDS ) ;
698
- await assetPairManagerV2 . initialPropose . sendTransactionAsync ( ) ;
699
- } ) ;
700
-
701
- async function subject ( ) : Promise < boolean > {
702
- await increaseChainTimeAsync ( web3 , subjectTimeFastForward ) ;
703
- return await assetPairManagerV2Wrapper . canConfirmPropose (
704
- subjectManagerAddress ,
705
- ) ;
706
- }
707
-
708
- test ( 'sets the recentInitialProposeTimestamp properly' , async ( ) => {
709
- const canInitialPropose = await subject ( ) ;
710
-
711
- expect ( canInitialPropose ) . to . be . true ;
712
- } ) ;
713
-
714
- describe ( 'when initialPropose not valid' , async ( ) => {
715
- beforeEach ( async ( ) => {
716
- subjectTimeFastForward = ZERO ;
717
- } ) ;
718
-
719
- test ( 'returns false' , async ( ) => {
720
- const canInitialPropose = await subject ( ) ;
721
-
722
- expect ( canInitialPropose ) . to . be . false ;
723
- } ) ;
724
- } ) ;
725
- } ) ;
726
-
727
580
describe ( 'setLiquidator' , async ( ) => {
728
581
let subjectNewLiquidator : Address ;
729
582
let subjectManagerAddress : Address ;
0 commit comments